job

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVar

type EnvVar struct {
	Variable string `json:"variable"`
	Value    string `json:"value"`
}

func (EnvVar) String added in v0.9.0

func (e EnvVar) String() string

type Environment added in v0.9.0

type Environment []EnvVar

func (Environment) Stringify added in v0.9.0

func (e Environment) Stringify() []string

type Job

type Job struct {
	ID             string      `json:"id,omitempty"`
	Name           string      `json:"name,omitempty"`
	Steps          []JobStep   `json:"steps,omitempty"`
	Environment    Environment `json:"environment,omitempty"`
	StepsCompleted int         `json:"stepsCompleted,omitempty"`
	Status         string      `json:"status,omitempty"`
}

func (Job) CurrentStep added in v0.9.0

func (j Job) CurrentStep() *JobStep

func (Job) CurrentStepEnvironment added in v0.9.0

func (j Job) CurrentStepEnvironment() Environment

type JobLog

type JobLog struct {
	Index int      `json:"index,omitempty"`
	Lines []string `json:"lines"`
}

type JobManager

type JobManager interface {
	ListAll() ([]Job, error)
	GetByID(string) (*Job, error)
	Create(*Job) error
	Execute(*Job) error
	GetLog(*Job, int) (*JobLog, error)
	Delete(*Job) error
}

func NewJobManager

func NewJobManager(r JobRepository, e JobStepExecutor) JobManager

type JobRepository added in v0.9.0

type JobRepository interface {
	All() ([]Job, error)
	Get(jobID string) (*Job, error)
	Create(job *Job) error
	Delete(jobID string) error
	Update(jobID, attr, value string) error
	GetJobLog(jobID string, index int) (*JobLog, error)
	AppendLogLine(jobID, logLine string) error
}

func NewJobRepository added in v0.9.0

func NewJobRepository(host string) JobRepository

type JobStep

type JobStep struct {
	Name           string      `json:"name,omitempty"`
	Source         string      `json:"source,omitempty"`
	Environment    Environment `json:"environment,omitempty"`
	Output         string      `json:"output,omitempty"`
	BeginDelimiter string      `json:"beginDelimiter,omitempty"`
	EndDelimiter   string      `json:"endDelimiter,omitempty"`
	Refresh        bool        `json:"refresh,omitempty"`
	// contains filtered or unexported fields
}

func (JobStep) FilePipePath added in v0.9.0

func (js JobStep) FilePipePath() string

func (JobStep) UsesDelimitedOutput added in v0.9.0

func (js JobStep) UsesDelimitedOutput() bool

func (JobStep) UsesFilePipe added in v0.9.0

func (js JobStep) UsesFilePipe() bool

func (JobStep) UsesStdErrPipe added in v0.9.0

func (js JobStep) UsesStdErrPipe() bool

func (JobStep) UsesStdOutPipe added in v0.9.0

func (js JobStep) UsesStdOutPipe() bool

type JobStepExecutor added in v0.9.0

type JobStepExecutor interface {
	Start(js *Job, stdIn io.Reader, stdOut, stdErr io.WriteCloser) error
	Inspect(js *Job) error
	CleanUp(js *Job) error
}

func NewExecutor added in v0.9.0

func NewExecutor(dockerEndpoint string) JobStepExecutor

type NotFoundError

type NotFoundError string

func (NotFoundError) Error

func (s NotFoundError) Error() string

Jump to

Keyboard shortcuts

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