cron

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EveryMidnight

func EveryMidnight(offsetHour int) string

EveryMidnight is the crontab of every midnight. EveyMidnight(0) means mid night in Beijing timezone.

func RunPeriodically

func RunPeriodically(ctx context.Context, runOnce bool, interval time.Duration, name string, action func(ctx context.Context) error) func()

RunPeriodically runs the given action periodically in a new goroutine. Returns a function used to stop.

func ServeCrontab

func ServeCrontab(ctx context.Context, runOnce bool, traceName string, crontab string, action func(ctx context.Context) error)

ServeCrontab runs the given action according to the crontab schedule.

Types

This section is empty.

Jump to

Keyboard shortcuts

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