Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCronManger = NewCronTabManger("DefaultCronManger")
View Source
var DefaultInterval = time.Second * 5
Functions ¶
func RemoveCronJob ¶
Types ¶
type CronManger ¶
type CronManger struct {
// contains filtered or unexported fields
}
func NewCronTabManger ¶
func NewCronTabManger(name string) *CronManger
func (*CronManger) AddCronJob ¶
func (*CronManger) Close ¶
func (c *CronManger) Close()
func (*CronManger) GetCron ¶
func (c *CronManger) GetCron() *cron.Cron
func (*CronManger) RemoveCronJob ¶
func (c *CronManger) RemoveCronJob(id cron.EntryID)
func (*CronManger) Start ¶
func (c *CronManger) Start() error
type Opt ¶
type Opt func(job *regularJob)
func WithImmediately ¶
func WithImmediately() Opt
func WithInterval ¶
WithInterval the execution interval time of job
type RegularJob ¶
type RegularJob interface {
Run()
Stop()
}
func NewRegularJob ¶
func NewRegularJob(name string, fn func(), opts ...Opt) RegularJob
Click to show internal directories.
Click to hide internal directories.