Documentation
¶
Index ¶
Constants ¶
const ( // IDLE denotes not running job which either hasn't been scheduled yet or its last run was successful. IDLE State = "Idle" // STAGING denotes job which has been scheduled to run in response to offer. STAGING = "Staging" // STARTING denotes job which has been lanunched by executor. STARTING = "Starting" // RUNNING denotes job which has been started. RUNNING = "Running" // FAILED denotes job whose last run failed. FAILED = "Failed" )
Variables ¶
var CronParser = cron.NewParser(cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow)
CronParser is a package-level parser for cron syntax.
Functions ¶
This section is empty.
Types ¶
type ContainerType ¶
type ContainerType string
ContainerType defines containerizer genre.
const ( // Docker denotes Docker containerizer. Docker ContainerType = "Docker" // Mesos denotes Mesos containerizer. // https://mesos.apache.org/documentation/latest/container-image/ Mesos = "Mesos" )
type Job ¶
type Job struct {
JobConf
JobRuntime
}
Job encompasses fields for job's configuration and runtime.
func (*Job) IsRetryable ¶
IsRetryable returns true if job's last run failed and job is eligible for retry.
func (*Job) IsRunnable ¶
IsRunnable returns true if job should be launched.
type JobConf ¶
type JobConf struct {
JobID
Schedule JobSchedule
Env map[string]string
Secrets map[string]string
Container JobContainer
CPUs float64
Mem float64
Disk float64
Cmd string
User string
Shell bool
Arguments []string
Labels map[string]string
MaxRetries int
}
JobConf defines job's configuration fields.
type JobContainer ¶
type JobContainer struct {
Type ContainerType
Docker *JobDocker `json:",omitempty"`
Mesos *JobMesos `json:",omitempty"`
}
JobContainer defines containerizer-related fields for job.
type JobID ¶
JobID defines job identifier.
func ParseJobID ¶
ParseJobID parses serialized job ID returned by String JobID.String method.
type JobMesos ¶
type JobMesos struct {
Image string
}
JobMesos defines fields for job running inside Mesos container. https://mesos.apache.org/documentation/latest/mesos-containerizer/
type JobRuntime ¶
type JobRuntime struct {
State State
LastStart time.Time
CurrentTaskID string
CurrentAgentID string
Retries int
}
JobRuntime defines job's runtime fields.
type JobSchedule ¶
type JobSchedule struct {
Type ScheduleType
Cron string `json:",omitempty"`
}
JobSchedule defines fields related to job's timetable.
type ScheduleType ¶
type ScheduleType string
ScheduleType defines timetable genre.
const ( // Cron denotes cron-like timetable. Cron ScheduleType = "Cron" )