Documentation ¶
Index ¶
Constants ¶
const MaxYearsAhead int = 5
MaxYearsAhead is maximum years in future we will try to lookup
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Id string // contains filtered or unexported fields }
Job definition
func (*Job) Next ¶
Next returns the next time for job to start and error in case it didn't find the time (e.g. all Schedules expired)
func (*Job) SetLastRun ¶
func (*Job) SetNextRun ¶
SetNextRun updates job nextRun field, which is actually used by Scheduler
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
Schedule struct is numeric representation of already parsed ScheduleSpec and is used during scheduling
func NewSchedule ¶
func NewSchedule(spec ScheduleSpec) (s Schedule, err error)
New creates Schedule with all available variants in numeric form from string based ScheduleSpec It sets sane defaults in case any entry is missing, but Minute, Hour, Day, Month must be specified. Year by default is * - "every year". Second by default is 0. Default Timezone (Location) - Local.
type ScheduleSpec ¶
type ScheduleSpec struct {
Second, Minute, Hour, Day, Weekday, Month, Year, Location string
}
ScheduleSpec defines time patterns to parse.
func (ScheduleSpec) String ¶
func (s ScheduleSpec) String() string