Documentation ¶
Index ¶
- type Job
- type JobQueue
- func (queue *JobQueue) AddJobs(jobs ...*Job)
- func (queue *JobQueue) FindJob(name string) (*Job, int)
- func (queue *JobQueue) JobExists(name string) bool
- func (queue *JobQueue) ReloadJob(name string) error
- func (queue *JobQueue) RemoveJob(name string) error
- func (queue *JobQueue) RestartJob(name string) error
- func (queue *JobQueue) StartQueue()
- func (queue *JobQueue) StopAllJobs()
- func (queue *JobQueue) StopJob(name string) error
- func (queue *JobQueue) TriggerJob(name string) error
- func (queue *JobQueue) WaitForAllJobs()
- type JobReturn
- type JobStatus
- type JobStore
- type TriggerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { //timers that get waited RegularTimer time.Duration `json:"regularTimer"` RetryTimer time.Duration `json:"retryTimer"` //Retry counter/limit CurrentRetry int `json:"CurrentRetry"` MaxFailedRetries int `json:"maxFailedRetries"` //statemachine status Status JobStatus `json:"status"` //the progress of the running restic command. not working. Progress float64 `json:"progress"` //times set when the wait is started WaitStart time.Duration `json:"WaitStart"` WaitEnd time.Duration `json:"WaitEnd"` //generic data from the config files JobNameToTrigger string `json:"NextJob"` JobName string `json:"JobName"` Username string `json:"Username"` Service string `json:"Service"` ResticPath string `json:"ResticPath"` ResticArguments []string `json:"ResticArguments"` // contains filtered or unexported fields }
Job represents one job that will be run in a Queue
func LoadJobFromFile ¶
LoadJobFromFile loads job from a file
func (*Job) SendTrigger ¶
func (job *Job) SendTrigger(trigType TriggerType)
SendTrigger makes the job run immediatly (if waiting or immediatly again if working right now)
func (*Job) SendTriggerWithDelay ¶
SendTriggerWithDelay makes the job run after "dur" nanoseconds
type JobQueue ¶
JobQueue managing the jobs
func NewJobQueue ¶
NewJobQueue creates a new JobQueue for the given directory
func (*JobQueue) ReloadJob ¶
ReloadJob reloads the file (with all changes made to it) and replaces the old job with the new one. the old job is stopped (and waited for until stopped) before the new job is started
func (*JobQueue) RestartJob ¶
RestartJob restarts the job with this name if it is present and in the "stopped" State
func (*JobQueue) StartQueue ¶
func (queue *JobQueue) StartQueue()
StartQueue starts all the jobs in the directory
func (*JobQueue) StopAllJobs ¶
func (queue *JobQueue) StopAllJobs()
StopAllJobs can take a long time depending on the jobs
func (*JobQueue) TriggerJob ¶
TriggerJob triggers the job with the extern trigger so it doesnt trigger itself afterwards
func (*JobQueue) WaitForAllJobs ¶
func (queue *JobQueue) WaitForAllJobs()
WaitForAllJobs does what it says it does
type TriggerType ¶
type TriggerType int
TriggerType extern triggers only followup jobs but does not retrigger himself