1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-17 16:12:42 +08:00
This commit is contained in:
2023-08-25 15:31:00 +08:00
parent 04aecd4abc
commit b0a97978d8
58 changed files with 1330 additions and 476 deletions

View File

@ -9,3 +9,16 @@ func ParseDuration(s string) (time.Duration, error) {
return time.ParseDuration(s)
}
func ParseDurationDefault(s string, d time.Duration) time.Duration {
if len(s) == 0 {
return d
}
ret, err := time.ParseDuration(s)
if err != nil {
return d
}
return ret
}

View File

@ -0,0 +1,14 @@
package calendar
import "time"
type ScheduledExecutor struct {
}
func NewScheduledExecutor() *ScheduledExecutor {
return &ScheduledExecutor{}
}
func (e *ScheduledExecutor) Schedule(i any, duration time.Duration) {
}

View File

@ -0,0 +1,14 @@
package calendar_test
import (
"testing"
"time"
"github.com/charlienet/go-mixed/calendar"
)
func TestExecutor(t *testing.T) {
executor := calendar.NewScheduledExecutor()
executor.Schedule(nil, time.Minute)
}