cron

package
v0.0.0-...-714bc2e Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(lf *lifecycle.Lifecycle, fn func(cron CronCmd) error) error

Append 添加定时任务,并且随着 lifecycle.Lifecycle 运行或停止

Types

type CronCmd

type CronCmd interface {
	AddFunc(spec string, action func()) (cron.EntryID, error)
}

CronCmd command of cron

type Stop

type Stop func() context.Context

Stop cron

func Run

func Run(fn func(cron CronCmd) error) (Stop, error)

Run 添加并运行定时任务,并返回 jobs 的 Stop 函数。

Jump to

Keyboard shortcuts

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