Documentation ¶
Overview ¶
Package gocron is scheduled task library.
Index ¶
- func DeleteTask(name string)
- func EveryHour(size int) string
- func EveryMinute(size int) string
- func EverySecond(size int) string
- func Everyday(size int) string
- func GetRunningTasks() []string
- func Init(opts ...Option) error
- func IsRunningTask(name string) bool
- func Run(tasks ...*Task) error
- func Stop()
- type Option
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRunningTasks ¶
func GetRunningTasks() []string
GetRunningTasks gets a list of running task names
func IsRunningTask ¶
IsRunningTask determine if the task is running
Types ¶
type Task ¶
type Task struct { // seconds (0-59) minutes (0- 59) hours (0-23) days (1-31) months (1-12) weeks (0-6) // "*/5 * * * * *" means every five seconds. // "0 15,45 9-12 * * * " indicates execution at the 15th and 45th minutes from 9 a.m. to 12 a.m. each day TimeSpec string Name string // task name Fn func() // task }
Task scheduled task
Click to show internal directories.
Click to hide internal directories.