job

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 8 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 is a struct that contains a store and a logger.

func NewService

func NewService(store store.Storer, log *otelzap.Logger) *Service

NewService creates a new job service with the given store and logger.

func (*Service) CreateJob

func (s *Service) CreateJob(ctx context.Context, jobCreate *model.JobCreate) (*model.Job, error)

CreateJob creates a new job using the given job create request and returns the created job. If the job create request is invalid, an error is returned.

func (*Service) DeleteJob

func (s *Service) DeleteJob(ctx context.Context, id uuid.UUID) error

DeleteJob deletes the job with the given ID.

func (*Service) FinishJobExecution

func (s *Service) FinishJobExecution(ctx context.Context, job *model.Job, startTime, stopTime time.Time, err error) error

func (*Service) GetJob

func (s *Service) GetJob(ctx context.Context, id uuid.UUID) (*model.Job, error)

GetJob returns the job with the given ID.

func (*Service) GetJobExecutions

func (s *Service) GetJobExecutions(ctx context.Context, id uuid.UUID, failedOnly bool, limit uint64, offset uint64) ([]*model.JobExecution, error)

func (*Service) GetJobsToRun

func (s *Service) GetJobsToRun(ctx context.Context, at time.Time, lockedUntil time.Time, instanceID string, limit uint) ([]*model.Job, error)

GetJobsToRun returns a list of jobs that should be run at the given time.

func (*Service) ListJobs

func (s *Service) ListJobs(ctx context.Context, limit, offset uint64, tags []string) ([]model.Job, error)

ListJobs returns a list of jobs with the given limit and offset.

func (*Service) UpdateJob

func (s *Service) UpdateJob(ctx context.Context, jobID uuid.UUID, jobUpdate model.JobUpdate) (*model.Job, error)

UpdateJob updates the given job.

Jump to

Keyboard shortcuts

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