Documentation ¶ Index ¶ type Cron func New(opts *Opts) *Cron func (c *Cron) Register(name string, cronTab string, fn JobFunc) func (c *Cron) Run() type JobFunc type Opts Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cron ¶ type Cron struct { // contains filtered or unexported fields } func New ¶ func New(opts *Opts) *Cron func (*Cron) Register ¶ func (c *Cron) Register(name string, cronTab string, fn JobFunc) func (*Cron) Run ¶ func (c *Cron) Run() type JobFunc ¶ type JobFunc func() error JobFunc function signature for job functions type Opts ¶ type Opts struct { // enable distributed lock in cluster nodes. // True: only one instance can execute. // False: multiple instances can execute, not preferable for multiple instances. DistLockEnable bool } Source Files ¶ View all Source files cron.go Click to show internal directories. Click to hide internal directories.