Documentation
¶
Overview ¶
定时调度器,必须先调用Init()初始化
┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of the month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday; │ │ │ │ │ 7 is also Sunday on some systems) │ │ │ │ │ │ │ │ │ │ * * * * * <command to execute>
用,指定多个时间,用*/指定间隔时间执行 */5 1,2,3 * * * echo hello world
Index ¶
Constants ¶
const ( // cron表达式 Minutely = "* * * * *" // 每分钟 Hourly = "@hourly" // 每小时 Weekly = "@weekly" // 每周 Monthly = "@monthly" // 每月 )
Variables ¶
This section is empty.
Functions ¶
func AddFunc ¶
AddFunc adds a func to the Cron to be run on the given schedule. Cron will run them in their own goroutines. 不会立即运行
func AddFuncNow ¶
AddFuncNow adds a func to the Cron to be run on the given schedule. Cron will run them in their own goroutines. 会立即运行一次
Types ¶
This section is empty.