Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Cron
- func (c *Cron) AddFunc(spec string, cmd func() error) (EntryID, error)
- func (c *Cron) AddJob(spec string, cmd NamedJob) (EntryID, error)
- func (c *Cron) GetEntryByName(name string) cron.Entry
- func (c *Cron) Run() error
- func (c *Cron) Schedule(schedule Schedule, job NamedJob) EntryID
- func (c *Cron) Stop() error
- type Entry
- type EntryID
- type FuncJob
- type Job
- type JobWrapper
- type NamedJob
- type Option
- type Parser
- type Schedule
Constants ¶
View Source
const ( // 任务锁 WorkerLockDir = "/xcron/lock/" DefaultTTL = 60 // default set DefaultWaitLockTime = 1000 // ms )
Variables ¶
View Source
var ( // Every ... Every = cron.Every // NewParser ... NewParser = cron.NewParser // NewChain ... NewChain = cron.NewChain // WithSeconds ... WithSeconds = cron.WithSeconds // WithParser ... WithParser = cron.WithParser // WithLocation ... WithLocation = cron.WithLocation )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { WithSeconds bool ConcurrentDelay int ImmediatelyRun bool // Distributed task DistributedTask bool WaitLockTime time.Duration *etcdv3.Config // contains filtered or unexported fields }
Config ...
func (*Config) WithChain ¶
func (config *Config) WithChain(wrappers ...JobWrapper) Config
WithChain ...
func (*Config) WithLogger ¶
WithLogger ...
type Cron ¶
type Cron struct { *Config *cron.Cron // contains filtered or unexported fields }
Cron ...
func (*Cron) GetEntryByName ¶
GetEntryByName ...
Click to show internal directories.
Click to hide internal directories.