client

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSubmitPayload

func BuildSubmitPayload(batchSubmitBody string) (*batch.SubmitPayload, error)

BuildSubmitPayload builds the payload for the batch submit endpoint from CLI flags.

func DecodeStatusResponse

func DecodeStatusResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeStatusResponse returns a decoder for responses returned by the batch status endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeSubmitResponse

func DecodeSubmitResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeSubmitResponse returns a decoder for responses returned by the batch submit endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeSubmitResponse may return the following errors:

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

func EncodeSubmitRequest

func EncodeSubmitRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeSubmitRequest returns an encoder for requests sent to the batch submit server.

func NewStatusBatchStatusResultOK

func NewStatusBatchStatusResultOK(body *StatusResponseBody) *batch.BatchStatusResult

NewStatusBatchStatusResultOK builds a "batch" service "status" endpoint result from a HTTP "OK" response.

func NewSubmitBatchResultAccepted

func NewSubmitBatchResultAccepted(body *SubmitResponseBody) *batch.BatchResult

NewSubmitBatchResultAccepted builds a "batch" service "submit" endpoint result from a HTTP "Accepted" response.

func NewSubmitNotAvailable

func NewSubmitNotAvailable(body *SubmitNotAvailableResponseBody) *goa.ServiceError

NewSubmitNotAvailable builds a batch service submit endpoint not_available error.

func NewSubmitNotValid

func NewSubmitNotValid(body *SubmitNotValidResponseBody) *goa.ServiceError

NewSubmitNotValid builds a batch service submit endpoint not_valid error.

func StatusBatchPath

func StatusBatchPath() string

StatusBatchPath returns the URL path to the batch service status HTTP endpoint.

func SubmitBatchPath

func SubmitBatchPath() string

SubmitBatchPath returns the URL path to the batch service submit HTTP endpoint.

func ValidateStatusResponseBody

func ValidateStatusResponseBody(body *StatusResponseBody) (err error)

ValidateStatusResponseBody runs the validations defined on StatusResponseBody

func ValidateSubmitNotAvailableResponseBody

func ValidateSubmitNotAvailableResponseBody(body *SubmitNotAvailableResponseBody) (err error)

ValidateSubmitNotAvailableResponseBody runs the validations defined on submit_not_available_response_body

func ValidateSubmitNotValidResponseBody

func ValidateSubmitNotValidResponseBody(body *SubmitNotValidResponseBody) (err error)

ValidateSubmitNotValidResponseBody runs the validations defined on submit_not_valid_response_body

func ValidateSubmitResponseBody

func ValidateSubmitResponseBody(body *SubmitResponseBody) (err error)

ValidateSubmitResponseBody runs the validations defined on SubmitResponseBody

Types

type Client

type Client struct {
	// Submit Doer is the HTTP client used to make requests to the submit endpoint.
	SubmitDoer goahttp.Doer

	// Status Doer is the HTTP client used to make requests to the status endpoint.
	StatusDoer goahttp.Doer

	// CORS Doer is the HTTP client used to make requests to the  endpoint.
	CORSDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the batch service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the batch service servers.

func (*Client) BuildStatusRequest

func (c *Client) BuildStatusRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildStatusRequest instantiates a HTTP request object with method and path set to call the "batch" service "status" endpoint

func (*Client) BuildSubmitRequest

func (c *Client) BuildSubmitRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildSubmitRequest instantiates a HTTP request object with method and path set to call the "batch" service "submit" endpoint

func (*Client) Status

func (c *Client) Status() goa.Endpoint

Status returns an endpoint that makes HTTP requests to the batch service status server.

func (*Client) Submit

func (c *Client) Submit() goa.Endpoint

Submit returns an endpoint that makes HTTP requests to the batch service submit server.

type StatusResponseBody

type StatusResponseBody struct {
	Running    *bool   `form:"running,omitempty" json:"running,omitempty" xml:"running,omitempty"`
	Status     *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	WorkflowID *string `form:"workflow_id,omitempty" json:"workflow_id,omitempty" xml:"workflow_id,omitempty"`
	RunID      *string `form:"run_id,omitempty" json:"run_id,omitempty" xml:"run_id,omitempty"`
}

StatusResponseBody is the type of the "batch" service "status" endpoint HTTP response body.

type SubmitNotAvailableResponseBody

type SubmitNotAvailableResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

SubmitNotAvailableResponseBody is the type of the "batch" service "submit" endpoint HTTP response body for the "not_available" error.

type SubmitNotValidResponseBody

type SubmitNotValidResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

SubmitNotValidResponseBody is the type of the "batch" service "submit" endpoint HTTP response body for the "not_valid" error.

type SubmitRequestBody

type SubmitRequestBody struct {
	Path     string `form:"path" json:"path" xml:"path"`
	Pipeline string `form:"pipeline" json:"pipeline" xml:"pipeline"`
}

SubmitRequestBody is the type of the "batch" service "submit" endpoint HTTP request body.

func NewSubmitRequestBody

func NewSubmitRequestBody(p *batch.SubmitPayload) *SubmitRequestBody

NewSubmitRequestBody builds the HTTP request body from the payload of the "submit" endpoint of the "batch" service.

type SubmitResponseBody

type SubmitResponseBody struct {
	WorkflowID *string `form:"workflow_id,omitempty" json:"workflow_id,omitempty" xml:"workflow_id,omitempty"`
	RunID      *string `form:"run_id,omitempty" json:"run_id,omitempty" xml:"run_id,omitempty"`
}

SubmitResponseBody is the type of the "batch" service "submit" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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