Versions in this module Expand all Collapse all v1 v1.0.0 Dec 19, 2023 Changes in this version + func AddTask(taskname string, t Tasker) + func DelTask(taskname string) + func GetAllTask() map[string]Tasker + func StartTask() + func Stats() map[string]TaskStats + func StopTask() + type MapSorter struct + Keys []string + Vals []Tasker + func NewMapSorter(m map[string]Tasker) *MapSorter + func (ms *MapSorter) Len() int + func (ms *MapSorter) Less(i, j int) bool + func (ms *MapSorter) Sort() + func (ms *MapSorter) Swap(i, j int) + type Schedule struct + Day uint64 + Hour uint64 + Minute uint64 + Month uint64 + Second uint64 + Week uint64 + func (s *Schedule) Next(t time.Time) time.Time + type Task struct + DoFunc TaskFunc + ErrLimit int + Errlist []*taskerr + Next time.Time + Prev time.Time + Spec *Schedule + Taskname string + func NewTask(tname string, spec string, f TaskFunc) *Task + func (t *Task) SetCron(spec string) + func (tk *Task) GetNext() time.Time + func (tk *Task) GetPrev() time.Time + func (tk *Task) GetStatus() string + func (tk *Task) Run() error + func (tk *Task) SetNext(now time.Time) + func (tk *Task) SetPrev(now time.Time) + type TaskFunc func() error + type TaskStats struct + ErrTimes int64 + Next time.Time + Prev time.Time + RunTimes int64 + type Tasker interface + GetNext func() time.Time + GetPrev func() time.Time + GetStatus func() string + Run func() error + SetNext func(time.Time) + SetPrev func(time.Time) + func GetTask(name string) Tasker