Versions in this module Expand all Collapse all v3 v3.0.2 Jun 6, 2022 Changes in this version + type Chain struct + func NewChain(c ...JobWrapper) Chain + func (c Chain) Then(j Job) Job + type ConstantDelaySchedule struct + Delay time.Duration + func Every(duration time.Duration) ConstantDelaySchedule + func (schedule ConstantDelaySchedule) Next(t time.Time) time.Time + type Cron struct + func New(opts ...Option) *Cron + func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) + func (c *Cron) AddJob(spec string, cmd Job) (EntryID, error) + func (c *Cron) Entries() []Entry + func (c *Cron) Entry(id EntryID) Entry + func (c *Cron) Location() *time.Location + func (c *Cron) Remove(id EntryID) + func (c *Cron) Run() + func (c *Cron) Schedule(schedule Schedule, cmd Job) EntryID + func (c *Cron) Start() + func (c *Cron) Stop() context.Context + type Entry struct + ID EntryID + Job Job + Next time.Time + Prev time.Time + Schedule Schedule + WrappedJob Job + func (e Entry) Valid() bool + type EntryID int + type FuncJob func() + func (f FuncJob) Run() + type Job interface + Run func() + type JobWrapper func(Job) Job + func DelayIfStillRunning(logger Logger) JobWrapper + func Recover(logger Logger) JobWrapper + func SkipIfStillRunning(logger Logger) JobWrapper + type Logger interface + Error func(err error, msg string, keysAndValues ...interface{}) + Info func(msg string, keysAndValues ...interface{}) + var DefaultLogger Logger = PrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags)) + var DiscardLogger Logger = PrintfLogger(log.New(ioutil.Discard, "", 0)) + func PrintfLogger(l interface{ ... }) Logger + func VerbosePrintfLogger(l interface{ ... }) Logger + type Option func(*Cron) + func WithChain(wrappers ...JobWrapper) Option + func WithLocation(loc *time.Location) Option + func WithLogger(logger Logger) Option + func WithParser(p ScheduleParser) Option + func WithSeconds() Option + type ParseOption int + const Descriptor + const Dom + const Dow + const DowOptional + const Hour + const Minute + const Month + const Second + const SecondOptional + type Parser struct + func NewParser(options ParseOption) Parser + func (p Parser) Parse(spec string) (Schedule, error) + type Schedule interface + Next func(time.Time) time.Time + func ParseStandard(standardSpec string) (Schedule, error) + type ScheduleParser interface + Parse func(spec string) (Schedule, error) + type SpecSchedule struct + CronExpr string + Dom uint64 + Dow uint64 + Hour uint64 + Location *time.Location + Minute uint64 + Month uint64 + Second uint64 + func (s *SpecSchedule) Next(t time.Time) time.Time Other modules containing this package github.com/AtomicConductor/cron