batch

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "batch"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"submit", "status"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeNotAvailable

func MakeNotAvailable(err error) *goa.ServiceError

MakeNotAvailable builds a goa.ServiceError from an error.

func MakeNotValid

func MakeNotValid(err error) *goa.ServiceError

MakeNotValid builds a goa.ServiceError from an error.

func NewStatusEndpoint

func NewStatusEndpoint(s Service) goa.Endpoint

NewStatusEndpoint returns an endpoint function that calls the method "status" of service "batch".

func NewSubmitEndpoint

func NewSubmitEndpoint(s Service) goa.Endpoint

NewSubmitEndpoint returns an endpoint function that calls the method "submit" of service "batch".

Types

type BatchResult

type BatchResult struct {
	WorkflowID string
	RunID      string
}

BatchResult is the result type of the batch service submit method.

type BatchStatusResult

type BatchStatusResult struct {
	Running    bool
	Status     *string
	WorkflowID *string
	RunID      *string
}

BatchStatusResult is the result type of the batch service status method.

type Client

type Client struct {
	SubmitEndpoint goa.Endpoint
	StatusEndpoint goa.Endpoint
}

Client is the "batch" service client.

func NewClient

func NewClient(submit, status goa.Endpoint) *Client

NewClient initializes a "batch" service client given the endpoints.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (res *BatchStatusResult, err error)

Status calls the "status" endpoint of the "batch" service.

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, p *SubmitPayload) (res *BatchResult, err error)

Submit calls the "submit" endpoint of the "batch" service. Submit may return the following errors:

  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • error: internal error

type Endpoints

type Endpoints struct {
	Submit goa.Endpoint
	Status goa.Endpoint
}

Endpoints wraps the "batch" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "batch" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "batch" service endpoints.

type Service

type Service interface {
	// Submit a new batch
	Submit(context.Context, *SubmitPayload) (res *BatchResult, err error)
	// Retrieve status of current batch operation.
	Status(context.Context) (res *BatchStatusResult, err error)
}

The batch service manages batches of collections.

type SubmitPayload

type SubmitPayload struct {
	Path     string
	Pipeline string
}

SubmitPayload is the payload type of the batch service submit method.

Jump to

Keyboard shortcuts

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