cron

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CRONLock = make(chan bool, 1)
View Source
var RunningLock = make(chan bool, 1)

Functions

func AddJobConfig

func AddJobConfig(job utils.CRONConfig)

func CancelJob

func CancelJob(scheduler string, jobName string) error

func DeleteJobRoute

func DeleteJobRoute(w http.ResponseWriter, req *http.Request)

func DeregisterJob

func DeregisterJob(scheduler string, name string)

func GetJobRoute

func GetJobRoute(w http.ResponseWriter, req *http.Request)

func GetJobsList

func GetJobsList() map[string]map[string]ConfigJob

func Init

func Init()

func InitJobs

func InitJobs()

func InitScheduler

func InitScheduler()

func JobFromCommand

func JobFromCommand(command string, args ...string) func(OnLog func(string), OnFail func(error), OnSuccess func(), ctx context.Context, cancel context.CancelFunc)

func JobFromContainerCommand

func JobFromContainerCommand(containerID string, command string, args ...string) func(OnLog func(string), OnFail func(error), OnSuccess func(), ctx context.Context, cancel context.CancelFunc)

func ListJobs

func ListJobs(w http.ResponseWriter, req *http.Request)

func ManualRunJob

func ManualRunJob(scheduler string, name string) error

func RegisterJob

func RegisterJob(job ConfigJob)

func RemoveJobConfig

func RemoveJobConfig(name string)

func ResetScheduler

func ResetScheduler(scheduler string)

func RunJobRoute

func RunJobRoute(w http.ResponseWriter, req *http.Request)

func RunOneTimeJob

func RunOneTimeJob(job ConfigJob)

func StopJobRoute

func StopJobRoute(w http.ResponseWriter, req *http.Request)

Types

type ConfigJob

type ConfigJob struct {
	Disabled       bool
	Scheduler      string
	Name           string
	Cancellable    bool
	Job            func(OnLog func(string), OnFail func(error), OnSuccess func(), ctx context.Context, cancel context.CancelFunc) `json:"-"`
	Crontab        string
	Running        bool
	LastStarted    time.Time
	LastRun        time.Time
	LastRunSuccess bool
	Logs           []string
	Ctx            context.Context    `json:"-"`
	CancelFunc     context.CancelFunc `json:"-"`
	Container      string
}

type JobRequestJSON

type JobRequestJSON struct {
	Scheduler string `validate:"required,min=3,max=32,alphanum"`
	Name      string `validate:"required,min=3,max=32,alphanum"`
}

Jump to

Keyboard shortcuts

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