scheduler

package
v1.99.99 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	JobType  k8upv1alpha1.JobType
	Schedule k8upv1alpha1.ScheduleDefinition
	Object   k8upv1alpha1.ObjectCreator
}

Job contains all necessary information to create a schedule.

type JobList

type JobList struct {
	Jobs   []Job
	Config job.Config
}

JobList contains a slice of jobs and job.Config to actually apply the the newJobs objects.

type Scheduler

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

Scheduler handles all the schedules.

func GetScheduler

func GetScheduler() *Scheduler

GetScheduler returns the scheduler singleton instance.

func (*Scheduler) HasSchedule

func (s *Scheduler) HasSchedule(namespacedName types.NamespacedName, schedule k8upv1alpha1.ScheduleDefinition, jobType k8upv1alpha1.JobType) bool

HasSchedule returns true if there is a schedule that matches the given criteria, otherwise false.

func (*Scheduler) RemoveSchedules

func (s *Scheduler) RemoveSchedules(namespacedName types.NamespacedName)

RemoveSchedules will remove the schedules of the given types.NamespacedName if existing.

func (*Scheduler) SyncSchedules

func (s *Scheduler) SyncSchedules(jobs JobList) error

SyncSchedules will add the given schedule to the running cron.

Jump to

Keyboard shortcuts

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