Versions in this module Expand all Collapse all v0 v0.0.1 Apr 6, 2022 Changes in this version + type Cron struct + func NewCron(cronExpression string) (*Cron, error) + func (c *Cron) Next() (time.Time, bool) + func (c *Cron) Reschedule(d time.Duration) + type ExecutionMiddleWare interface + Initilize func(s *Task) + PostHandler func(s *Task, err error) MWResult + PreHandler func(s *Task) (MWResult, error) + Reset func(s *Task) + type Fixed struct + func NewFixed(duration time.Duration) (*Fixed, error) + func (f *Fixed) Next() (time.Time, bool) + func (f *Fixed) Reschedule(t time.Duration) + type MWResult struct + Result MWResult_Op + type MWResult_Op int + const MWResult_Cancel + const MWResult_Defer + const MWResult_NextMW + type Once struct + func NewOnce(d time.Duration) (*Once, error) + func NewOnceTime(t time.Time) (*Once, error) + func (o *Once) Next() (time.Time, bool) + func (o *Once) Reschedule(d time.Duration) + type Option interface + func WithExecutationMiddleWare(handler ExecutionMiddleWare) Option + func WithLogger(logger logr.Logger) Option + func WithRetryMiddleWare(handler RetryMiddleware) Option + type RetryMiddleware interface + Handler func(s *Task, prerun bool, e error) (retry RetryResult, err error) + Initilize func(s *Task) + Reset func(s *Task) (ok bool) + type RetryResult struct + Delay time.Duration + Result RetryResult_Op + type RetryResult_Op int + const RetryResult_NextMW + const RetryResult_NoRetry + const RetryResult_Retry + type Scheduler struct + func NewScheduler(opts ...Option) *Scheduler + func (s *Scheduler) Add(ctx context.Context, id string, timer Timer, job func(context.Context), ...) error + func (s *Scheduler) GetAllSchedules() (map[string]*Task, error) + func (s *Scheduler) GetSchedule(id string) (*Task, error) + func (s *Scheduler) Start(id string) error + func (s *Scheduler) StartAll() + func (s *Scheduler) Stop(id string) error + func (s *Scheduler) StopAll() + type Task struct + Ctx context.Context + Logger logr.Logger + func NewSchedule(ctx context.Context, id string, timer Timer, jobFunc func(context.Context), ...) *Task + func (s *Task) GetID() string + func (s *Task) GetNextRun() time.Time + func (s *Task) Run() + func (s *Task) Start() + func (s *Task) Stop() + type Timer interface + Next func() (next time.Time, done bool) + Reschedule func(delay time.Duration) + type UpdateSignalOp_Type int