Versions in this module Expand all Collapse all v3 v3.0.4 Jan 17, 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, name string, cmd func()) (EntryID, error) + func (c *Cron) AddJob(spec string, name 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) RunJob(e *Entry) + func (c *Cron) Schedule(spec string, schedule Schedule, name string, cmd Job) EntryID + func (c *Cron) Start() + func (c *Cron) Stop() context.Context + type Entry struct + ID EntryID + Job Job + Name string + Next time.Time + Prev time.Time + Schedule Schedule + Spec string + WrappedJob Job + func (e *Entry) ResetNext(now time.Time) + 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 + Print func(args ...interface{}) + var DefaultLogger Logger = log.New(os.Stdout, "cron: ", log.LstdFlags) + var DiscardLogger Logger = log.New(ioutil.Discard, "", 0) + 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 + 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/18211167516/robfig-cron