Documentation
¶
Index ¶
Constants ¶
View Source
const ( JobTypeKill = "kill" JobTypeExec = "exec" JobTypeStart = "start" JobTypeStop = "stop" JobTypeRestart = "restart" )
Variables ¶
View Source
var JobTypeMap = map[string]string{ "kill": JobTypeKill, "signal": JobTypeKill, "exec": JobTypeExec, "start": JobTypeStart, "stop": JobTypeStop, "restart": JobTypeRestart, }
JobTypeMap maps given label value to the correct (internal) type
Functions ¶
Types ¶
type Cronify ¶
type Cronify struct {
DockerClient *client.Client
MaxConcurrentJobs int
JobList []*Job
// contains filtered or unexported fields
}
Cronify
func (*Cronify) RemoveJobsByContainerID ¶
type Job ¶
type Job struct {
JobName string
// Schedule is currently implemented as cron syntax
Schedule string
Run *JobTypeConfig
Fail map[string]*JobTypeConfig
Success map[string]*JobTypeConfig
// contains filtered or unexported fields
}
Job represent the full job
type JobDockerExec ¶
type JobDockerExec struct {
Client *client.Client
Config *JobTypeConfig
LogWriter io.Writer
}
JobDockerExec implements JobExecution for attached container executions
type JobDockerKill ¶
type JobDockerKill struct {
Client *client.Client
Config *JobTypeConfig
}
JobDockerKill implements JobExecution for sending process signals
type JobDockerRestart ¶
type JobDockerRestart struct {
Client *client.Client
Config *JobTypeConfig
}
JobDockerRestart restarts container
type JobDockerStart ¶
type JobDockerStart struct {
Client *client.Client
Config *JobTypeConfig
}
JobDockerStart starts container
type JobDockerStop ¶
type JobDockerStop struct {
Client *client.Client
Config *JobTypeConfig
}
JobDockerStop stops container
type JobExecution ¶
type JobExecution interface {
// contains filtered or unexported methods
}
JobExecution represent a job to execute
type JobTypeConfig ¶
type JobTypeConfig struct {
// Timeout this job after the duration
Timeout time.Duration
// Type of this job
Type string
// Wait for an command to finish (daemon?). Used for start.
Wait bool
// Signal to send if type is kill
Signal string
// Command to execute if type is exec
Command []string
// Container in context to run the job
// send signal to this container, start/stop/restart this container or exec command in this container
Container string
}
JobTypeConfig configures the job/trigger to run
func (*JobTypeConfig) NewExecution ¶
func (j *JobTypeConfig) NewExecution(dockerClient *client.Client) (JobExecution, error)
NewExecution create a new execution wrapper
Click to show internal directories.
Click to hide internal directories.