Documentation
¶
Overview ¶
Package schedule is a small library that helps you specify recurring tasks in a cronjob-like interface (without actually using cron's syntax).
Index ¶
- Constants
- type Entry
- func (e *Entry) Daily() *Entry
- func (e *Entry) DailyAt(spec string) *Entry
- func (e *Entry) Days(days ...cronDay) *Entry
- func (e *Entry) EveryFifteenMinutes() *Entry
- func (e *Entry) EveryFiveMinutes() *Entry
- func (e *Entry) EveryMinute() *Entry
- func (e *Entry) EveryTenMinutes() *Entry
- func (e *Entry) EveryThirtyMinutes() *Entry
- func (e *Entry) Fridays() *Entry
- func (e *Entry) Hourly() *Entry
- func (e *Entry) Mondays() *Entry
- func (e *Entry) Saturdays() *Entry
- func (e *Entry) String() string
- func (e *Entry) Sundays() *Entry
- func (e *Entry) Thursdays() *Entry
- func (e *Entry) Tuesdays() *Entry
- func (e *Entry) Wednesdays() *Entry
- func (e *Entry) Weekdays() *Entry
- func (e *Entry) Weekly() *Entry
- type RunFunc
- type Runner
- type Schedule
Constants ¶
const ( // Sunday is representation of cron's 0 for Sundays Sunday = cronDay("0") // Monday is representation of cron's 1 for Mondays Monday = cronDay("1") // Tuesday is representation of cron's 2 for Tuesdays Tuesday = cronDay("2") // Wednesday is representation of cron's 3 for Wednesdays Wednesday = cronDay("3") // Thursday is representation of cron's 4 for Thursdays Thursday = cronDay("4") // Friday is representation of cron's 5 for Fridays Friday = cronDay("5") // Saturday is representation of cron's 6 for Saturdays Saturday = cronDay("6") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Command Runner
// contains filtered or unexported fields
}
Entry is the holding type that has the crons specification for when the job has to run This is stored in the unexported field expression. Command keeps track of the actual func to run
func (*Entry) DailyAt ¶
DailyAt gives you more flexibility in specifying exactly at what time the Runner should be executed You need to specify the spec like "15:23". This func panics if an invalid argument is given!
func (*Entry) Days ¶
Days specifies the days the Runner should be executed on. This follows the specification for cron jobs, meaning it goes from 0–6 or SUN–SAT
func (*Entry) EveryFifteenMinutes ¶
EveryFifteenMinutes specifies that this entry should be executed every fifteen minutes
func (*Entry) EveryFiveMinutes ¶
EveryFiveMinutes specifies that this entry should be executed every five minutes
func (*Entry) EveryMinute ¶
EveryMinute specifies that this entry should be executed every single minute
func (*Entry) EveryTenMinutes ¶
EveryTenMinutes specifies that this entry should be executed every ten minutes
func (*Entry) EveryThirtyMinutes ¶
EveryThirtyMinutes specifies that this entry should be executed every thirty minutes
func (*Entry) Hourly ¶
Hourly specifies that this entry should be executed every hour at the minute 0
func (*Entry) Wednesdays ¶
Wednesdays runs every Wednesday every minute (if not specified further)
type RunFunc ¶
RunFunc is a wrapper for Runner to use plain functions instead of implementing a type for Runner