jobs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 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) FS

func (service *Service) FS() filesystem.FS

FS returns the services's filesystem

func (*Service) GetAllJobs

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

GetAllJobs returns all jobs

func (*Service) GetJob

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

GetJob returns the job with the given id

func (*Service) GetJobLog

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

GetJobLog returns the log of a job

func (*Service) JobsDirectory

func (service *Service) JobsDirectory() string

JobsDirectory contains saved data for jobs such as logs

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