Documentation ¶
Index ¶
- Variables
- type Job
- type JobFunc
- type JobOnError
- type Scheduler
- func (s *Scheduler) GetById(id string) *Job
- func (s *Scheduler) RunEvery(id string, f JobFunc, duration time.Duration) error
- func (s *Scheduler) RunOnce(id string, f JobFunc, t time.Time) error
- func (s *Scheduler) Schedule(f JobFunc, option *TaskDefinition, options ...*TaskDefinition) error
- func (s *Scheduler) SetOnError(e JobOnError)
- func (s *Scheduler) Start()
- func (s *Scheduler) Timeout(id string, f JobFunc, timeout time.Duration) error
- func (s *Scheduler) Unschedule(id string)
- type TaskDefinition
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCannotRunInPast = fmt.Errorf("cron: could not run a task in the past") ErrInfiniteRunWithNoInterval = fmt.Errorf("cron: could not run a task recurrently without interval") )
Functions ¶
This section is empty.
Types ¶
type JobOnError ¶
type JobOnError func(error)
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler() *Scheduler
func (*Scheduler) Schedule ¶
func (s *Scheduler) Schedule(f JobFunc, option *TaskDefinition, options ...*TaskDefinition) error
func (*Scheduler) SetOnError ¶
func (s *Scheduler) SetOnError(e JobOnError)
func (*Scheduler) Unschedule ¶
Click to show internal directories.
Click to hide internal directories.