cron

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func Task

func Task(handler ...Handler)

Task 用于tasks注册任务

Types

type Handler

type Handler struct {
	//cron表达式
	//(1) */2 * * * * *     每个偶数分执行text
	//(2) */2 */2 * * * *   每个偶数分 并且是偶数秒执行text
	//(3) 2,4,6 * * * * *   每分钟的2,4,6这三个秒执行text
	//(4) 2,4,6 5-6 * * * 1 每周一的5点2,4,6秒和6点2,4,6秒执行text
	//(5) @daily            每天一次
	//(6) @midnight         同上
	//(7) @every 1m30s      定时1分30秒执行text
	Cron string
	//实际处理方法
	Handler func()
	//执行顺序
	Sort int
	//初始化是否执行(懒加载)
	Lazy bool
}

Jump to

Keyboard shortcuts

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