package
0.0.12
Repository: https://github.com/fankane/go-utils.git
Documentation: pkg.go.dev

# README

cron 表达式

*  *   *   *   *  
分 时  日  月   周 

CRON 有如下两种语法格式:

  • cron 通用语法
    • */1 * * * *: 每一分钟的开始执行,除第一次外,其他的间隔时间都是1分钟
  • 快捷语法
    • @yearly:也可以写作@annually,表示每年第一天的 0 点。等价于0 0 1 1 *;
    • @monthly:表示每月第一天的 0 点。等价于0 0 1 * *;
    • @weekly:表示每周第一天的 0 点,注意第一天为周日,即周六结束,周日开始的那个 0 点。等价于0 0 * * 0;
    • @daily:也可以写作@midnight,表示每天 0 点。等价于0 0 * * *;
    • @hourly:表示每小时的开始。等价于0 * * * *。
    • @every : 每隔duration触发一次。例如 @every 1h30m10s
*:表示匹配任意值。假如在分字段使用*,即表示每分钟都将执行一次。
?:表示无指定字段,只能用在日期和星期两个字段。
-:表示匹配范围。例如在分钟字段使用5-20,表示在5分到20分钟之间,每分钟执行一次 。
/:表示从起始时间开始执行,每隔固定时间执行一次。例如在分钟字段使用5/20,表示从5分开始,每隔20分钟执行一次,也即25分、45分各执行一次。
,:表示列出枚举值。例如:在分钟字段使用5,20,表示在5分和20分各执行一次。

# Functions

CronDo 定期执行函数, 快速开始,无法停止;完整版请使用下面的 NewCron().Do() 按需开始和停止.
DelayDo 延迟 delay 时间后执行 do.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TickerDo 每隔 every 时间后执行 do.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

日.
时.
No description provided by the author
月.
分.
秒.
年.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author