crontabJobs

package
v0.0.0-...-25b5904 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCronJob

func AddCronJob(m *CrontabManager, name string, job *CrontabJob) bool

添加任务

func AsyncRun

func AsyncRun(job *CrontabJob, queue chan *Result)

异步运行

func FLog

func FLog(name string, res *Result)

打印日志

func GetJobHandlerExector

func GetJobHandlerExector(job *CrontabJob) *exec.Cmd

获取定时任务执行器

func RemoveAll

func RemoveAll(m *CrontabManager) int

移除所有

func RemoveCronJob

func RemoveCronJob(m *CrontabManager, name string) bool

移除任务

func StartCrontabProcess

func StartCrontabProcess(m *CrontabManager, resQueue chan *Result, state chan *State)

启动crontab 进程

Types

type CrontabJob

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

定时任务

func CreateJob

func CreateJob(bin string, args []string, expr string) (*CrontabJob, error)

创建一个定时任务

type CrontabManager

type CrontabManager map[string]*CrontabJob

定时任务记录表

func CreateCrontabManager

func CreateCrontabManager() CrontabManager

创建任务列表

type JobHandler

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

任务处理器

type Result

type Result struct {
	Output []byte
	Err    error
}

执行结果

func ExecJob

func ExecJob(job *CrontabJob) (*Result, error)

执行任务

type State

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

状态

Jump to

Keyboard shortcuts

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