request

package
v0.8.2-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package request provides an interface for managing requests.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParams = errors.New("invalid request type and/or arguments")
)

Functions

This section is empty.

Types

type ErrInvalidState

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

func NewErrInvalidState

func NewErrInvalidState(expectedState, actualState string) ErrInvalidState

func (ErrInvalidState) Error

func (e ErrInvalidState) Error() string

type Manager

type Manager interface {
	// Create creates a proto.Request and saves it to the db.
	Create(proto.CreateRequestParams) (proto.Request, error)

	// Get retreives the request corresponding to the provided id.
	Get(requestId string) (proto.Request, error)

	// Start starts a request (sends it to the JR).
	Start(requestId string) error

	// Stop stops a request (sends a stop signal to the JR).
	Stop(requestId string) error

	// Status returns the status of a request and all of the jobs in it.
	// The live status output of any jobs that are currently running will be
	// included as well.
	Status(requestId string) (proto.RequestStatus, error)

	// Finish marks a request as being finished. It gets the request's final
	// state from the proto.FinishRequestParams argument.
	Finish(requestId string, finishParams proto.FinishRequestParams) error

	// IncrementFinishedJobs increments the count of the FinishedJobs field
	// on the request and saves it to the db.
	IncrementFinishedJobs(requestId string) error

	// Specs returns a list of all the request specs the the RM knows about.
	Specs() []proto.RequestSpec

	// JobChain returns the job chain for the given request id.
	JobChain(requestId string) (proto.JobChain, error)
}

A Manager is used to create and manage requests.

func NewManager

func NewManager(grf grapher.GrapherFactory, dbc myconn.Connector, jrClient jr.Client) Manager

Jump to

Keyboard shortcuts

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