Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyCronSchedule = errors.New("cron schedule is empty") InvalidCronSchedule = errors.New("invalid cron schedule") )
Functions ¶
This section is empty.
Types ¶
type Cron ¶
type Cron struct {
// contains filtered or unexported fields
}
Cron represents the cron schedule
func Parse ¶
Parse takes a standard cron schedule (* * * * *) and returns a Cron object if the schedule is valid; otherwise, it returns an error. It uses goroutines to parse each part of the schedule concurrently, resulting in faster parsing.
The schedule follows the standard format:
* [0-59] (* , / -)
* [0-23] (* , / -)
* [1-31] (* , / -)
* [1-12] (* , / -)
* [0-6] (* , / -)
func (*Cron) NextFrom ¶
NextFrom accepts a time in which it will calculate the next activation time after
func (*Cron) PrevBefore ¶
PrevBefore accepts a time in which it will calculate the previous activation time before now
Click to show internal directories.
Click to hide internal directories.