job

package
v0.8.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("job not found")

ErrNotFound represents a job not found error

Functions

This section is empty.

Types

type Cleanup

type Cleanup func()

Cleanup function for workdir

type ID

type ID uuid.UUID

ID is the identifier of job

func (ID) ToSlice

func (i ID) ToSlice() []byte

ToSlice returns slice value

type Job

type Job struct {
	ID       ID
	Finished bool      `json:"finished"`
	Stream   []LogLine `json:"stream"`
}

Job represents a task

func (*Job) AppendLog

func (j *Job) AppendLog(line LogLine)

AppendLog append log line to stream

func (*Job) Finish

func (j *Job) Finish()

Finish set true to Finished

func (*Job) ToBytes

func (j *Job) ToBytes() ([]byte, error)

ToBytes returns marshal byte slice

type Log

type Log interface {
	ReadLine() (*LogLine, error)
}

Log is a interface represents docker log.

type LogLine

type LogLine struct {
	Timestamp time.Time `json:"time"`
	Message   string    `json:"message"`
}

LogLine stores timestamp and message.

type Repository

type Repository interface {
	FindBy(ID) (*Job, error)
	Save(Job) error
}

Repository is Job Repository

type Target

type Target interface {
	Prepare(context.Context) (WorkDir, Cleanup, error)
}

Target represents build target

type WorkDir

type WorkDir string

WorkDir is a working directory for build job

func (WorkDir) String

func (w WorkDir) String() string

String returns string value

Directories

Path Synopsis
Package mock_job is a generated GoMock package.
Package mock_job is a generated GoMock package.
git
git/mock_git
Package mock_git is a generated GoMock package.
Package mock_git is a generated GoMock package.
github/mock_github
Package mock_github is a generated GoMock package.
Package mock_github is a generated GoMock package.

Jump to

Keyboard shortcuts

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