task

package
v0.0.0-...-ddfd2c2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Funcs []*FuncEntry

Functions

func Add

func Add(t db.Task) error

添加

func Entries

func Entries() []cron.Entry

运行中的任务

func Fire

func Fire(uuid string) error

立即执行

func IsPathValid

func IsPathValid(fpath string, task_type int) error

检查 path 是否有效

func Remove

func Remove(uuid string) error

删除

func Replace

func Replace(t db.Task, uuid string) error

替换

func Startup

func Startup(conf *config.ViperConfig) error

启动任务调度

func Stop

func Stop()

停止任务调度

Types

type FuncEntry

type FuncEntry struct {
	Name string
	Path string
	Func func()
}

type Job

type Job struct {
	Task    db.Task
	Func    func()
	Running abool.AtomicBool
}

func (*Job) Run

func (j *Job) Run()

type Scheduler

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

Jump to

Keyboard shortcuts

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