Versions in this module Expand all Collapse all v2 v2.7.2 Aug 2, 2024 Changes in this version + const StatusClosed + const StatusReady + const StatusRunning + const StatusStopped + func DelayAdd(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func DelayAddEntry(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc, ...) + func DelayAddOnce(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func DelayAddSingleton(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func DelayAddTimes(ctx context.Context, delay time.Duration, interval time.Duration, times int, ...) + func Exit() + func SetInterval(ctx context.Context, interval time.Duration, job JobFunc) + func SetTimeout(ctx context.Context, delay time.Duration, job JobFunc) + type Entry struct + func Add(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func AddEntry(ctx context.Context, interval time.Duration, job JobFunc, isSingleton bool, ...) *Entry + func AddOnce(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func AddSingleton(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func AddTimes(ctx context.Context, interval time.Duration, times int, job JobFunc) *Entry + func (entry *Entry) Close() + func (entry *Entry) Ctx() context.Context + func (entry *Entry) IsSingleton() bool + func (entry *Entry) Job() JobFunc + func (entry *Entry) Reset() + func (entry *Entry) Run() + 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 = func(ctx context.Context) + type Timer struct + func New(options ...TimerOptions) *Timer + func (t *Timer) Add(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func (t *Timer) AddEntry(ctx context.Context, interval time.Duration, job JobFunc, isSingleton bool, ...) *Entry + func (t *Timer) AddOnce(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func (t *Timer) AddSingleton(ctx context.Context, interval time.Duration, job JobFunc) *Entry + func (t *Timer) AddTimes(ctx context.Context, interval time.Duration, times int, job JobFunc) *Entry + func (t *Timer) Close() + func (t *Timer) DelayAdd(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func (t *Timer) DelayAddEntry(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc, ...) + func (t *Timer) DelayAddOnce(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func (t *Timer) DelayAddSingleton(ctx context.Context, delay time.Duration, interval time.Duration, job JobFunc) + func (t *Timer) DelayAddTimes(ctx context.Context, delay time.Duration, interval time.Duration, times int, ...) + func (t *Timer) Start() + func (t *Timer) Stop() + type TimerOptions struct + Interval time.Duration + Quick bool + func DefaultOptions() TimerOptions