Versions in this module Expand all Collapse all v1 v1.0.2 Nov 28, 2021 v1.0.1 Nov 28, 2021 Changes in this version + const StatusClosed + const StatusReady + const StatusRunning + const StatusStopped + func DelayAdd(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func DelayAddOnce(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func DelayAddSingleton(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func DelayAddTimes(ctx context.Context, delay time.Duration, pattern string, times int, ...) + func GetLogger() *glog.Logger + func Remove(name string) + func SetLogger(logger *glog.Logger) + func Size() int + func Start(name ...string) + func Stop(name ...string) + type Cron struct + func New() *Cron + func (c *Cron) Add(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func (c *Cron) AddEntry(ctx context.Context, pattern string, job JobFunc, times int, isSingleton bool, ...) (*Entry, error) + func (c *Cron) AddOnce(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func (c *Cron) AddSingleton(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func (c *Cron) AddTimes(ctx context.Context, pattern string, times int, job JobFunc, name ...string) (*Entry, error) + func (c *Cron) Close() + func (c *Cron) DelayAdd(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func (c *Cron) DelayAddEntry(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func (c *Cron) DelayAddOnce(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func (c *Cron) DelayAddSingleton(ctx context.Context, delay time.Duration, pattern string, job JobFunc, ...) + func (c *Cron) DelayAddTimes(ctx context.Context, delay time.Duration, pattern string, times int, ...) + func (c *Cron) Entries() []*Entry + func (c *Cron) GetLogger() *glog.Logger + func (c *Cron) Remove(name string) + func (c *Cron) Search(name string) *Entry + func (c *Cron) SetLogger(logger *glog.Logger) + func (c *Cron) Size() int + func (c *Cron) Start(name ...string) + func (c *Cron) Stop(name ...string) + type Entry struct + Job JobFunc + Name string + Time time.Time + func Add(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func AddOnce(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func AddSingleton(ctx context.Context, pattern string, job JobFunc, name ...string) (*Entry, error) + func AddTimes(ctx context.Context, pattern string, times int, job JobFunc, name ...string) (*Entry, error) + func Entries() []*Entry + func Search(name string) *Entry + func (entry *Entry) Close() + func (entry *Entry) IsSingleton() bool + func (entry *Entry) SetSingleton(enabled bool) + func (entry *Entry) SetStatus(status int) int + func (entry *Entry) SetTimes(times int) + func (entry *Entry) Start() + func (entry *Entry) Status() int + func (entry *Entry) Stop() + type JobFunc = gtimer.JobFunc