Versions in this module Expand all Collapse all v1 v1.1.1 Aug 9, 2023 v1.1.0 Aug 2, 2023 Changes in this version + type Dcron struct + RecoverFunc RecoverFuncType + ServerName string + func NewDcron(serverName string, driver driver.DriverV2, cronOpts ...cron.Option) *Dcron + func NewDcronWithOption(serverName string, driver driver.DriverV2, dcronOpts ...Option) *Dcron + func (d *Dcron) AddFunc(jobName, cronStr string, cmd func()) (err error) + func (d *Dcron) AddJob(jobName, cronStr string, job Job) (err error) + func (d *Dcron) GetLogger() dlog.Logger + func (d *Dcron) Remove(jobName string) + func (d *Dcron) Run() + func (d *Dcron) SetLogger(logger dlog.Logger) + func (d *Dcron) Start() + func (d *Dcron) Stop() + type INodePool interface + CheckJobAvailable func(jobName string) bool + GetNodeID func() string + Start func(ctx context.Context) error + Stop func(ctx context.Context) error + func NewNodePool(serviceName string, drv driver.DriverV2, updateDuration time.Duration, ...) INodePool + type Job interface + Run func() + type JobWarpper struct + CronStr string + Dcron *Dcron + Func func() + ID cron.EntryID + Job Job + Name string + func (job JobWarpper) Run() + type NodePool struct + func (np *NodePool) CheckJobAvailable(jobName string) bool + func (np *NodePool) GetNodeID() string + func (np *NodePool) Start(ctx context.Context) (err error) + func (np *NodePool) Stop(ctx context.Context) error + type Option func(*Dcron) + func CronOptionChain(wrappers ...cron.JobWrapper) Option + func CronOptionLocation(loc *time.Location) Option + func CronOptionParser(p cron.ScheduleParser) Option + func CronOptionSeconds() Option + func WithHashReplicas(d int) Option + func WithLogger(logger dlog.Logger) Option + func WithNodeUpdateDuration(d time.Duration) Option + func WithPrintLogInfo() Option + func WithRecoverFunc(recoverFunc RecoverFuncType) Option + type RecoverFuncType func(d *Dcron) + type StableJob interface + GetCron func() string + Serialize func() ([]byte, error) + UnSerialize func([]byte) error