cron

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cron 实现了 cron 表达式的 Scheduler 接口

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(spec string) (schedulers.Scheduler, error)

Parse 分析 spec 内容,得到 schedule.Scheduler 实例。

spec 的值可以是:

  • * * * * * | | | | | | | | | | | --- 星期 | | | | ----- 月 | | | ------- 日 | | --------- 小时 | ----------- 分 ------------- 秒

星期与日若同时存在,则以或的形式组合。

支持以下符号:

  • 表示范围 , 表示和

同时支持以下便捷指令:

@reboot:   启动时执行一次
@yearly:   0 0 0 1 1 *
@annually: 0 0 0 1 1 *
@monthly:  0 0 0 1 * *
@weekly:   0 0 0 * * 0
@daily:    0 0 0 * * *
@midnight: 0 0 0 * * *
@hourly:   0 0 * * * *

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL