scheduler

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: BSD-3-Clause Imports: 13 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 string
	Object   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 ObjectCreator

type ObjectCreator interface {
	CreateObject(name, namespace string) runtime.Object
}

ObjectCreator defines an interface that each schedulable newJobs must implement. The simplest implementation is that the concrete object just returns itself.

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) RemoveSchedules

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

RemoveSchedules will remove the schedules with 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