jobs

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manages jobs

func New

func New(db *database.Database, fs filesystem.FS) *Service

New creates a jobs service

func (*Service) CreateBuildJob added in v0.8.0

func (service *Service) CreateBuildJob(uploadID uint) (*models.Job, error)

CreateBuildJob creates a build job

func (*Service) GetAllJobArtifactsByJobID added in v0.8.0

func (service *Service) GetAllJobArtifactsByJobID(jobID uint) ([]*models.JobArtifact, error)

GetAllJobArtifactsByJobID returns a list of all artifacts for a job

func (*Service) GetAllJobs

func (service *Service) GetAllJobs() ([]*models.Job, error)

GetAllJobs returns all jobs

func (*Service) GetAllJobsByUploadID added in v0.8.0

func (service *Service) GetAllJobsByUploadID(uploadID uint) ([]*models.Job, error)

GetAllJobsByUploadID returns all jobs for a given upload

func (*Service) GetJob

func (service *Service) GetJob(id uint) (*models.Job, error)

GetJob returns the job with the given id

func (*Service) GetJobArtifact added in v0.8.0

func (service *Service) GetJobArtifact(jobID uint, filename string) (io.ReadCloser, error)

GetJobArtifact returns a job artifact

func (*Service) GetJobLog

func (service *Service) GetJobLog(jobID uint) (io.ReadCloser, error)

GetJobLog returns the log of a job

func (*Service) SaveJobArtifact added in v0.8.0

func (service *Service) SaveJobArtifact(jobID uint, filename string, content io.Reader) error

SaveJobArtifact will save a job artifact

func (*Service) SaveJobLog

func (service *Service) SaveJobLog(jobID uint, content io.Reader) error

SaveJobLog will save logs for a job

func (*Service) UnqueueNextJob

func (service *Service) UnqueueNextJob() (*models.Job, error)

UnqueueNextJob returns the next job and marks it as assigned

func (*Service) UpdateJob

func (service *Service) UpdateJob(job *models.Job) error

UpdateJob will update a job

Jump to

Keyboard shortcuts

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