cron

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: MIT Imports: 9 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 初始化 schedulers.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