Documentation
¶
Index ¶
- type Info
- type Schedule
- func (c *Schedule) AddFunc(spec string, cmd func(context2 *core.Context)) (cron.EntryID, error)
- func (c *Schedule) AddIdOrReplaceKeyFunc(id uint, key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, bool, error)
- func (c *Schedule) AddKeyFunc(key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, bool, error)
- func (c *Schedule) GetIds() []uint
- func (c *Schedule) Init(ctx *core.Context) error
- func (c *Schedule) ReplaceKeyFunc(key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, error)
- func (c *Schedule) Run() error
- func (c *Schedule) StopIdFunc(id uint)
- func (c *Schedule) StopKeyFunc(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
Schedule manages cron jobs with key-based and ID-based lifecycle control.
func NewSchedule ¶
NewSchedule creates a new Schedule with the given cron options.
func NewScheduleWithSeconds ¶
func NewScheduleWithSeconds() *Schedule
NewScheduleWithSeconds creates a new Schedule that supports second-level cron granularity.
func (*Schedule) AddIdOrReplaceKeyFunc ¶
func (c *Schedule) AddIdOrReplaceKeyFunc(id uint, key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, bool, error)
AddIdOrReplaceKeyFunc adds or replaces a cron job identified by a numeric ID.
func (*Schedule) AddKeyFunc ¶
func (c *Schedule) AddKeyFunc(key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, bool, error)
AddKeyFunc adds a cron job if no job with the given key exists.
func (*Schedule) ReplaceKeyFunc ¶
func (c *Schedule) ReplaceKeyFunc(key string, spec string, cmd func(context2 *core.Context)) (cron.EntryID, error)
ReplaceKeyFunc replaces a cron job identified by key with a new spec and command.
func (*Schedule) StopIdFunc ¶
StopIdFunc stops a cron job identified by its numeric ID.
func (*Schedule) StopKeyFunc ¶
StopKeyFunc stops a cron job identified by its key.
Click to show internal directories.
Click to hide internal directories.