Documentation
¶
Index ¶
- func FormatSpec(second, minute, hour, day, month, weekday interface{}) string
- type DelayedTask
- type Scheduler
- func (s *Scheduler) AddFunc(name string, spec string, task Task) error
- func (s *Scheduler) Cron(name string, spec string, task Task) error
- func (s *Scheduler) Daily(name string, task Task) error
- func (s *Scheduler) DailyAt(name string, hour, minute int, task Task) error
- func (s *Scheduler) EveryFiveMinutes(name string, task Task) error
- func (s *Scheduler) EveryMinute(name string, task Task) error
- func (s *Scheduler) EverySeconds(name string, seconds int, task Task) error
- func (s *Scheduler) GetJobs() map[string]cron.EntryID
- func (s *Scheduler) Hourly(name string, task Task) error
- func (s *Scheduler) Monthly(name string, task Task) error
- func (s *Scheduler) Remove(name string)
- func (s *Scheduler) Start()
- func (s *Scheduler) Stop()
- func (s *Scheduler) Weekly(name string, task Task) error
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSpec ¶
func FormatSpec(second, minute, hour, day, month, weekday interface{}) string
FormatSpec 格式化cron规范 例如: FormatSpec(0, 30, 14, "*", "*", "*") -> "0 30 14 * * *"
Types ¶
type DelayedTask ¶
type DelayedTask struct {
// contains filtered or unexported fields
}
DelayedTask 延迟任务
func NewDelayedTask ¶
func NewDelayedTask(task Task, delay time.Duration) *DelayedTask
NewDelayedTask 创建延迟任务
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler 任务调度器
func (*Scheduler) EveryFiveMinutes ¶
EveryFiveMinutes 每5分钟执行
func (*Scheduler) EveryMinute ¶
EveryMinute 每分钟执行
func (*Scheduler) EverySeconds ¶
EverySeconds 每N秒执行
Click to show internal directories.
Click to hide internal directories.