job

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BeginDelimiter = "----BEGIN PANAMAX DATA----"
	EndDelimiter   = "----END PANAMAX DATA----"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Create() error
	Attach(stdIn io.Reader, stdOut, stdErr io.Writer) error
	Start() error
	Inspect() error
	Remove() error
}

type ContainerFactory

type ContainerFactory interface {
	NewContainer(source string, env []string) Container
}

func NewContainerFactory

func NewContainerFactory(dockerEndpoint string) ContainerFactory

type EnvVar

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

type Job

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

type JobAccessor

type JobAccessor 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 NewJobAccessor

func NewJobAccessor(host string) JobAccessor

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(a JobAccessor, cf ContainerFactory) JobManager

type JobStep

type JobStep struct {
	Name        string   `json:"name,omitempty"`
	Source      string   `json:"source,omitempty"`
	Environment []EnvVar `json:"environment,omitempty"`
}

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