Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Next ¶
func Next(pattern Pattern, allowCurrentTime bool) (time.Time, error)
Next calculates the next time that matches the pattern after the current time See NextAfter for more details
func NextAfter ¶
func NextAfter(pattern Pattern, origin time.Time, inclusive bool) (time.Time, error)
NextAfter calculates the next time that matches the pattern after the origin time If inclusive is true, the origin time is considered a valid match All calculations are done in UTC, and the result is returned in UTC
Types ¶
type Pattern ¶
type Pattern struct {
Duration *string `parser:"@(Number ('s' | 'm' | 'h'))"`
DayOfWeek *DayOfWeek `parser:"| @('Mon' | 'Tue' | 'Wed' | 'Thu' | 'Fri' | 'Sat' | 'Sun')"`
Components []Component `parser:"| @@+"`
// contains filtered or unexported fields
}
Pattern represents a cron schedule.
type Step ¶
type Step struct {
ValueRange ValueRange `parser:"@@"`
Step *int `parser:"('/' @Number)?"`
}
type ValueRange ¶
type ValueRange struct {
IsFullRange bool `parser:"(@'*'"`
Start *int `parser:"| @Number"`
End *int `parser:"('-' @Number)?)"`
}
Click to show internal directories.
Click to hide internal directories.