Documentation ¶
Index ¶
- Variables
- func AddTask(taskname string, t *Task)
- func DeleteTask(taskname string)
- func SetTaskEnable(taskname string, enable bool)
- func StartTask()
- func StopTask()
- type Handler
- type MapSorter
- type Schedule
- type Task
- func (t *Task) GetNext() time.Time
- func (t *Task) GetPrev() time.Time
- func (t *Task) GetSpec() string
- func (t *Task) GetStatus() string
- func (t *Task) Run(params string) error
- func (t *Task) SetCron(spec string)
- func (t *Task) SetEnable(enable bool)
- func (t *Task) SetNext(now time.Time)
- func (t *Task) SetPrev(now time.Time)
- func (t *Task) SetSpec(spec string)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AdminTaskList map[string]*Task
)
Functions ¶
func DeleteTask ¶
func DeleteTask(taskname string)
func SetTaskEnable ¶
Types ¶
type MapSorter ¶
func NewMapSorter ¶
type Schedule ¶
type Task ¶
type Task struct { Taskname string Params string Spec *Schedule SpecStr string DoFunc Handler Prev time.Time Next time.Time Errlist []*taskerr ErrLimit int IsEnable bool }
func (*Task) SetCron ¶
SetCron some signals:
*: any time ,: separate signal
-:duration
/n : do as n times of time duration
///////////////////////////////////////////////////////
0/30 * * * * * every 30s 0 43 21 * * * 21:43 0 15 05 * * * 05:15 0 0 17 * * * 17:00 0 0 17 * * 1 17:00 in every Monday 0 0,10 17 * * 0,2,3 17:00 and 17:10 in every Sunday, Tuesday and Wednesday 0 0-10 17 1 * * 17:00 to 17:10 in 1 min duration each time on the first day of month 0 0 0 1,15 * 1 0:00 on the 1st day and 15th day of month 0 42 4 1 * * 4:42 on the 1st day of month 0 0 21 * * 1-6 21:00 from Monday to Saturday 0 0,10,20,30,40,50 * * * * every 10 min duration 0 */10 * * * * every 10 min duration 0 * 1 * * * 1:00 to 1:59 in 1 min duration each time 0 0 1 * * * 1:00 0 0 */1 * * * 0 min of hour in 1 hour duration 0 0 * * * * 0 min of hour in 1 hour duration 0 2 8-20/3 * * * 8:02, 11:02, 14:02, 17:02, 20:02 0 30 5 1,15 * * 5:30 on the 1st day and 15th day of month
Click to show internal directories.
Click to hide internal directories.