Documentation ¶
Index ¶
Constants ¶
View Source
const ( PolicyTimes = "Times" PolicyOnce = "Once" PolicyNever = "Never" StrategyDelay = "Delay" StrategySkip = "Skip" )
Variables ¶
View Source
var Schedule schedule
Schedule 定时器
Functions ¶
Types ¶
type Job ¶
type Job struct { ID *cron.EntryID `json:"-"` //cron内部ID Code string `json:"Code"` //任务键名 Name string `json:"Name"` //任务名 Param any `json:"Param"` //参数 Func func(any) any `json:"-"` //执行函数 Spec string `json:"Spec"` //执行表达式 Next times.PrettyTime `json:"Next"` //下次执行时间 Prev times.PrettyTime `json:"Prev"` //上次执行时间 Result any `json:"Result"` //上次执行结果 Times int64 `json:"Times"` //执行次数 Policy string `json:"Policy"` //执行策略 Times定时执行/Once执行一次/Never仅存储 Strategy string `json:"Strategy"` //当上一任务未完成时策略 Delay/Skip // contains filtered or unexported fields }
Job 任务
Click to show internal directories.
Click to hide internal directories.