Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ZeroTrigger = &zeroTrigger{}
Functions ¶
Types ¶
type CronSequencer ¶
func NewCronSequencer ¶ added in v1.0.12
func NewCronSequencer(cron string) *CronSequencer
func (*CronSequencer) Cron ¶ added in v1.0.12
func (cs *CronSequencer) Cron() string
func (*CronSequencer) Next ¶
func (cs *CronSequencer) Next(date time.Time) time.Time
* Get the next {@link Date} in the sequence matching the Cron pattern and * after the value provided. The return value will have a whole number of * seconds, and will be after the input value. * @param date a seed value * @return the next value matching the pattern
func (*CronSequencer) Parse ¶
func (cs *CronSequencer) Parse(expression string) (err error)
Parse parse the cron exception ┌───────────── second (0 - 59) │ ┌───────────── minute (0 - 59) │ │ ┌───────────── hour (0 - 23) │ │ │ ┌───────────── day of the month (1 - 31) │ │ │ │ ┌───────────── month (1 - 12) │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday; 7 is also Sunday) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * * * * * * Comma ( , ): used to separate items of a list. For example, "MON,WED,FRI". Dash ( - ) : used to define ranges. For example, "1-10" Slash (/) : combined with ranges to specify step values. For example, */5 in the minutes field indicates every 5 minutes It is shorthand for the more verbose POSIX form "5,10,15,20,25,30,35,40,45,50,55,00"
type CronTrigger ¶
type CronTrigger struct {
CronSequencer
}
func NewCronTrigger ¶
func NewCronTrigger(cron string) *CronTrigger
func (*CronTrigger) NextExecutionTime ¶
func (ct *CronTrigger) NextExecutionTime(task *Task) time.Time
type DelayedTrigger ¶
func (*DelayedTrigger) NextExecutionTime ¶
func (dt *DelayedTrigger) NextExecutionTime(task *Task) time.Time
type PeriodicTrigger ¶
func (*PeriodicTrigger) NextExecutionTime ¶
func (pt *PeriodicTrigger) NextExecutionTime(task *Task) time.Time
type Scheduler ¶
Scheduler task scheduler
func Default ¶
func Default() *Scheduler
Default returns the default Scheduler instance used by the package-level functions.