job

package
v0.0.0-...-daf4bef Latest Latest
Warning

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

Go to latest
Published: Jun 9, 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 Repository

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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