Documentation ¶
Index ¶
- Constants
- Variables
- type Component
- func (c *Component) AddFunc(spec string, cmd func() error) (EntryID, error)
- func (c *Component) AddJob(spec string, cmd NamedJob) (EntryID, error)
- func (c *Component) GetEntryByName(name string) cron.Entry
- func (c *Component) Init() error
- func (c *Component) Name() string
- func (c *Component) PackageName() string
- func (c *Component) Schedule(schedule Schedule, job NamedJob) EntryID
- func (c *Component) Start() error
- func (c *Component) Stop() error
- type Config
- type Container
- type Ecron
- type Entry
- type EntryID
- type FuncJob
- type Job
- type JobWrapper
- type Locker
- type NamedJob
- type Option
- type Parser
- type Schedule
Constants ¶
View Source
const PackageName = "task.ecron"
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 Component ¶
type Component struct { Config *Config *cron.Cron // contains filtered or unexported fields }
Component ...
func (*Component) GetEntryByName ¶
GetEntryByName ...
func (*Component) PackageName ¶
type Config ¶
type Config struct { WithSeconds bool // 是否使用秒作解析器,默认否 ConcurrentDelay int // 并发延迟,默认是执行超过定时时间后,下次执行的任务会跳过 ImmediatelyRun bool // 是否立刻执行,默认否 DistributedTask bool // 是否分布式任务,默认否,如果存在分布式任务,则会解析嵌入的etcd配置 WaitLockTime time.Duration // 抢锁等待时间,默认0s Endpoints []string // etcd地址 ConnectTimeout time.Duration // 连接超时时间,默认5s Secure bool // 是否安全通信,默认false AutoSyncInterval time.Duration // 自动同步member list的间隔 TTL int // 过期时间,单位:s,默认失效时间为0s WorkerLockDir string // 定时任务锁目录 // contains filtered or unexported fields }
Config ...
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func DefaultContainer ¶
func DefaultContainer() *Container
Click to show internal directories.
Click to hide internal directories.