mjob

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mjob is the client entrypoint package for job-manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(c client.Interface, r consumer.Runner, providers ...consumer.Provider) *consumer.Consumer

NewConsumer creates a new job consumer. Consumers can target one or all queues. See mjob/consumer.Provider docs for confuration options.

Types

type Client added in v0.4.0

type Client = client.Interface

Client is the interface for the job-manager http client in package mjob/client.

type Job

type Job = resource.Job

Job is the job type declared in mjob/resource.

type QueueCache added in v0.3.0

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

QueueCache can be used to minimize requests to the job server for queue data. It prunes old queue versions to ensure it runs with bounded memory.

func NewQueueCache added in v0.3.0

func NewQueueCache(c client.Interface) *QueueCache

func (*QueueCache) Get added in v0.3.0

func (qc *QueueCache) Get(ctx context.Context, job *resource.Job) (*resource.Queue, error)

func (*QueueCache) Reset added in v0.3.0

func (qc *QueueCache) Reset()

type Result added in v0.4.0

type Result = resource.JobResult

Result is the job result type declared in mjob/resource.

func RunFailed added in v0.4.0

func RunFailed(err error, data interface{}) (*Result, error)

RunFailed returns a failed job result with optional error and data. It is intended to be used as the return value to implementations of Runner.

func RunInvalid

func RunInvalid(err error, data interface{}) (*Result, error)

func RunSucceeded added in v0.4.0

func RunSucceeded(data interface{}) (*Result, error)

RunSucceeded returns a successful job result with optional data. It is intended to be used as the return value to implementations of Runner.

Directories

Path Synopsis
api
v1
Package v1 contains types for the v1 job-manager api.
Package v1 contains types for the v1 job-manager api.
Package apply saves a yaml manifest to a job-manager server.
Package apply saves a yaml manifest to a job-manager server.
Package client contains the base job-manager http client.
Package client contains the base job-manager http client.
Package consumer implements a job executor.
Package consumer implements a job executor.
Package internal contains code not exported by the mjob package.
Package internal contains code not exported by the mjob package.
Package label contains function managing labels and selectors.
Package label contains function managing labels and selectors.
Package logger provides an interface for customizable client logging.
Package logger provides an interface for customizable client logging.
Package querystring is a fork of github.com/google/go-querystring
Package querystring is a fork of github.com/google/go-querystring
Package resource provides model representations that users of job-manager typically interact with.
Package resource provides model representations that users of job-manager typically interact with.
job/v1
Package v1 contains the protocol for working with jobs and queues.
Package v1 contains the protocol for working with jobs and queues.
Package schema validates job arguments and result data with jsonschema.
Package schema validates job arguments and result data with jsonschema.

Jump to

Keyboard shortcuts

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