scheduler

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT = 1

Variables

View Source
var RunStatusNames = []string{
	"none",
	"running",
	"succeeded",
	"failed",
	"cancelled",
	"abandoned",
}

Functions

func FindNamedStringCaptures

func FindNamedStringCaptures(re *regexp.Regexp, x string) map[string]string

func Run

func Run() (request_chan chan Request)

Types

type ChangeJobStatusRequest

type ChangeJobStatusRequest struct {
	Name   string
	Status RunStatus
}

Change Job Status

type CommandRun

type CommandRun struct {
	RunInfo
	CommandSpecified string
	CommandRun       string
	Error            string
	StatusCode       int
	StdOutURI        string `json:",omitempty"`
	StdErrURI        string `json:",omitempty"`
}

type HostRun

type HostRun struct {
	RunInfo
	JobName     string
	RunId       int
	Host        string
	HostId      int
	CommandRuns []CommandRun
}

type Job

type Job struct {
	config.JobSpec
	RunInfo
	RunId           int
	RunsOutstanding int
	RunsQueued      int
	LastChecked     time.Time
	PoolIndex       int
	History         JobHistory `json:"-"`
}

Job runtime

func New

func New(spec *config.JobSpec) (*Job, error)

type JobHistory

type JobHistory []JobRun

func (JobHistory) Len

func (slice JobHistory) Len() int

Sortable interface

func (JobHistory) Less

func (slice JobHistory) Less(i, j int) bool

func (JobHistory) Swap

func (slice JobHistory) Swap(i, j int)

type JobList

type JobList map[string]*Job

type JobNotifier

type JobNotifier struct {
	config.Notifier
}

func (JobNotifier) Notify

func (notifier JobNotifier) Notify(job *Job)

type JobReport

type JobReport struct {
	Job
	DetailURI string
}

type JobReportWithHistory

type JobReportWithHistory struct {
	Job
	PoolHosts []string
	DetailURI string
	Runs      JobHistory
}

type JobRun

type JobRun struct {
	RunInfo
	RunId     int
	JobName   string `json:",omitempty"`
	HostRuns  []HostRun
	DetailURI string `json:",omitempty"`
}

func (JobRun) GetHostRunById

func (jr JobRun) GetHostRunById(id int) *HostRun

type JobsByName

type JobsByName []JobReport

func (JobsByName) Len

func (slice JobsByName) Len() int

func (JobsByName) Less

func (slice JobsByName) Less(i, j int) bool

func (JobsByName) Swap

func (slice JobsByName) Swap(i, j int)

type LoadConfigRequest

type LoadConfigRequest string

Load config request

type Request

type Request interface{}

Base request

type RunInfo

type RunInfo struct {
	Status    RunStatus
	StartTime time.Time
	EndTime   time.Time
}

type RunJobRequest

type RunJobRequest string

Run a job

type RunStatus

type RunStatus int
const (
	None RunStatus = iota
	Running
	Succeeded
	Failed
	Cancelled
	Abandoned
)

type StatusRequest

type StatusRequest struct {
	Object []string
	Chan   chan StatusResponse
}

Status Request (report job, run or host/command details)

type StatusResponse

type StatusResponse interface{}

Response

type UpdatePoolRequest

type UpdatePoolRequest struct {
	Name  string
	Hosts []string
}

Jump to

Keyboard shortcuts

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