cron

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2017 License: Apache-2.0 Imports: 7 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 (*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) GetEntries

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

GetEntries lists the cron entries

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

func (dj *DockerJob) Deactivate()

Deactivate Sets the Active 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

Jump to

Keyboard shortcuts

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