README ¶ cron Cron is a lightweight cron job library that uses a single goroutine to manage the scheduling of all jobs, so please do not block the execution process. Licensed under the MIT License. See LICENSE for the full license text. Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Cron func NewCron() *Cron func (t *Cron) Add(nextFunc NextFunc, doFunc DoFunc) bool func (t *Cron) AddWithCancel(nextFunc NextFunc, doFunc DoFunc) (cancelFunc DoFunc, ok bool) type DoFunc type NextFunc func Order(ts ...time.Time) NextFunc Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cron ¶ type Cron struct { // contains filtered or unexported fields } Cron is a cron job manager. func NewCron ¶ func NewCron() *Cron NewCron returns a new Cron. func (*Cron) Add ¶ func (t *Cron) Add(nextFunc NextFunc, doFunc DoFunc) bool Add adds a job to the cron. func (*Cron) AddWithCancel ¶ func (t *Cron) AddWithCancel(nextFunc NextFunc, doFunc DoFunc) (cancelFunc DoFunc, ok bool) AddWithCancel adds a job to the cron and returns a function to cancel the job. type DoFunc ¶ type DoFunc func() type NextFunc ¶ type NextFunc func(now time.Time) (time.Time, bool) func Order ¶ func Order(ts ...time.Time) NextFunc Order is an order timer. Source Files ¶ View all Source files cron.go order.go Directories ¶ Show internal Expand all Path Synopsis crontab Click to show internal directories. Click to hide internal directories.