Documentation
¶
Index ¶
- Variables
- func Next(kind Kind, value string, from time.Time, loc *time.Location) (time.Time, error)
- func NextNotBefore(kind Kind, value string, from, earliest time.Time, loc *time.Location) (due time.Time, limited bool, err error)
- func NextScheduled(schedule cron.Schedule, from, earliest time.Time) time.Time
- func ParseDate(value string, loc *time.Location) (time.Time, error)
- func ParseSchedule(expr string, loc *time.Location) (cron.Schedule, error)
- func Validate(kind Kind, value string) error
- type CronSchedule
- type Duration
- type Kind
Constants ¶
This section is empty.
Variables ¶
var ErrNoNextOccurrence = errors.New("timer has no further occurrence")
Functions ¶
func Next ¶
Next returns the first due time of a timer definition after from. A cycle is either a Quartz cron expression or an ISO 8601 repeating interval R[n]/<duration>.
func NextNotBefore ¶
func NextNotBefore(kind Kind, value string, from, earliest time.Time, loc *time.Location) (due time.Time, limited bool, err error)
NextNotBefore is Next for a timer that must not be due before earliest (MIN_TIMER_DURATION). A duration or repeating interval due earlier is due at earliest, a cron expression at its first time at or after earliest; a date is never moved. limited reports a moved due time.
func NextScheduled ¶
NextScheduled returns the first start of a schedule after from and not before earliest (MIN_TIMER_DURATION): a cron at its first time at or after earliest, @every at earliest. Zero if there is none.
func ParseSchedule ¶
ParseSchedule parses a cron of a time schedule in loc.
Types ¶
type CronSchedule ¶
type CronSchedule struct {
// contains filtered or unexported fields
}
CronSchedule is a Quartz cron expression with 6 or 7 fields: seconds minutes hours day-of-month month day-of-week [year].
type Duration ¶
Duration is an ISO 8601 duration. Years, months, weeks and days are calendar units, hours, minutes and seconds are fixed. Implementation follows ISO 8601-1:2019 section 5.5.2.4 (format with designators).