crontab

package
v0.0.0-...-6c655be Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronHandle

type CronHandle struct {
	Cron *cron.Cron
	// contains filtered or unexported fields
}

func New

func New() *CronHandle

func (*CronHandle) AddFunc

func (self *CronHandle) AddFunc(name, spec string, function func()) error

func (*CronHandle) AddJob

func (self *CronHandle) AddJob(task *CronJob) error

func (*CronHandle) DeleteAllTask

func (self *CronHandle) DeleteAllTask()

func (*CronHandle) DeleteTask

func (self *CronHandle) DeleteTask(taskName string)

func (*CronHandle) Run

func (self *CronHandle) Run()

type CronJob

type CronJob struct {
	Name        string            // 任務名稱
	Spec        string            // 任務排程
	CallBack    func(interface{}) // 排程啟動任務
	TaskContext interface{}       // 任務內容
}

任務資料

func (*CronJob) Run

func (self *CronJob) Run()

Jump to

Keyboard shortcuts

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