Versions in this module Expand all Collapse all v1 v1.0.1 Mar 5, 2018 v1.0.0 Mar 4, 2018 Changes in this version + 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 ...CronOpt) (*Cron, error) + func (c *Cron) AddJob(job Job) error + func (c *Cron) Entries() []*Entry + func (c *Cron) Schedule(schedule Schedule, job Job) + func (c *Cron) Start(ctx context.Context) + func (c *Cron) Stop() + type CronOpt func(cron *Cron) + func WithErrorsHandler(f func(context.Context, Job, error)) CronOpt + func WithEtcdErrorsHandler(f func(context.Context, Job, error)) CronOpt + func WithEtcdMutexBuilder(b EtcdMutexBuilder) CronOpt + func WithFuncCtx(f func(context.Context, Job) context.Context) CronOpt + type DistributedMutex interface + IsOwner func() clientv3.Cmp + Key func() string + Lock func(ctx context.Context) error + Unlock func(ctx context.Context) error + type Entry struct + Job Job + Next time.Time + Prev time.Time + Schedule Schedule + type EtcdMutexBuilder interface + NewMutex func(pfx string) (DistributedMutex, error) + func NewEtcdMutexBuilder(config clientv3.Config) (EtcdMutexBuilder, error) + type Job struct + Func func(context.Context) error + Name string + Rhythm string + func (j Job) Run(ctx context.Context) error + type Schedule interface + Next func(time.Time) time.Time + func Parse(spec string) (_ Schedule, err error) + type SpecSchedule struct + Dom uint64 + Dow uint64 + Hour uint64 + Minute uint64 + Month uint64 + Second uint64 + func (s *SpecSchedule) Next(t time.Time) time.Time