cron

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Scheduler *gocron.Scheduler

Scheduler 调度器

Functions

This section is empty.

Types

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job 任务

func Clock

func Clock(hours int, minutes int, fn func()) (*Job, error)

Clock 创建每日任务

func ClockWithWeekdays

func ClockWithWeekdays(hours int, minutes int, weekdays []time.Weekday, fn func()) (*Job, error)

ClockWithWeekdays 创建每日任务

func Interval

func Interval(interval int, fn func()) (*Job, error)

Interval 创建周期任务

func Schedule

func Schedule(crontab string, fn func()) (*Job, error)

Schedule 创建任务

func (*Job) Cancel

func (j *Job) Cancel()

Cancel 取消任务

Jump to

Keyboard shortcuts

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