cron

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crontab

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

Crontab is the struct that holds the cron runner

func NewCrontab

func NewCrontab() (*Crontab, error)

NewCrontab creates the crontab

func NewRancherTypeCrontab added in v0.3.0

func NewRancherTypeCrontab(metadataURL string) (*Crontab, error)

func (*Crontab) AddJob

func (ct *Crontab) AddJob(id string, labels map[string]string, jobType string) error

AddJob Adds a docker job to the crontab

func (*Crontab) DeactivateJob added in v0.3.0

func (ct *Crontab) DeactivateJob(id string, labels map[string]string) error

func (*Crontab) GetEntries

func (ct *Crontab) GetEntries() []cron.Entry

GetEntries lists the cron entries

func (*Crontab) GetNumberOfActiveJobs added in v0.3.0

func (ct *Crontab) GetNumberOfActiveJobs() float64

func (*Crontab) GetNumberOfInactiveJobs added in v0.3.0

func (ct *Crontab) GetNumberOfInactiveJobs() float64

func (*Crontab) RemoveJob

func (ct *Crontab) RemoveJob(id string)

RemoveJob remove a docker job from the cron queue

type DockerJob

type DockerJob struct {
	ID                 string
	Action             string
	Schedule           string
	Leader             bool
	Labels             map[string]string
	RancherServiceUUID string
	Active             bool
	// contains filtered or unexported fields
}

DockerJob implements the cron job interface

func NewDockerJob

func NewDockerJob(id string, labels map[string]string) *DockerJob

NewDockerJob creates a DockerJob and sets defaults

func (*DockerJob) Activate added in v0.3.0

func (dj *DockerJob) Activate()

func (*DockerJob) Deactivate

func (dj *DockerJob) Deactivate()

Deactivate Sets the Actve attribute to false. This will skip running

func (*DockerJob) Err

func (dj *DockerJob) Err() error

Err returns last error message

func (*DockerJob) Run

func (dj *DockerJob) Run()

Run Implements the job interface from cron package

type JobEntry added in v0.3.0

type JobEntry struct {
	CronID cron.EntryID
	Job    *DockerJob
}

Jump to

Keyboard shortcuts

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