job

package
v0.0.0-...-5222202 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimOptions

type ClaimOptions struct {
	JobID string
	Names []string
}

type JobStatus

type JobStatus string
const (
	JobStatusQueued  JobStatus = "QUEUED"
	JobStatusClaimed JobStatus = "CLAIMED"
	JobStatusSuccess JobStatus = "SUCCESS"
	JobStatusError   JobStatus = "ERROR"
)

type Reporter

type Reporter interface {
	GetCountByNameByStatus(ctx context.Context) (map[string]map[JobStatus]int64, error)
}

type Repository

type Repository interface {
	// crud
	Get(ctx context.Context, id string) (*goqmodel.Job, error)
	List(ctx context.Context, args *goqmodel.ListJobsQueryParams) (*goqmodel.ListJobsResponse, error)
	Search(ctx context.Context, args *goqmodel.SearchJobsRequest) (*goqmodel.SearchJobsResponse, error)
	Delete(ctx context.Context, id string) error
	// job queue semantics
	Queue(ctx context.Context, j *goqmodel.Job) (*goqmodel.Job, error)
	Claim(ctx context.Context, opts *ClaimOptions) (*goqmodel.Job, error)
	Release(ctx context.Context, id string) (*goqmodel.Job, error)
	Success(ctx context.Context, id string, output goqmodel.JSONObject) (*goqmodel.Job, error)
	Error(ctx context.Context, id string, output goqmodel.JSONObject) (*goqmodel.Job, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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