client

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDividePayload

func BuildDividePayload(dividerDivideA string, dividerDivideB string) (*divider.FloatOperands, error)

BuildDividePayload builds the payload for the divider divide endpoint from CLI flags.

func BuildIntegerDividePayload

func BuildIntegerDividePayload(dividerIntegerDivideA string, dividerIntegerDivideB string) (*divider.IntOperands, error)

BuildIntegerDividePayload builds the payload for the divider integer_divide endpoint from CLI flags.

func DecodeDivideResponse

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

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

  • "div_by_zero" (type *goa.ServiceError): http.StatusBadRequest
  • "timeout" (type *goa.ServiceError): http.StatusGatewayTimeout
  • error: internal error

func DecodeIntegerDivideResponse

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

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

  • "has_remainder" (type *goa.ServiceError): http.StatusExpectationFailed
  • "div_by_zero" (type *goa.ServiceError): http.StatusBadRequest
  • "timeout" (type *goa.ServiceError): http.StatusGatewayTimeout
  • error: internal error

func DivideDividerPath

func DivideDividerPath(a float64, b float64) string

DivideDividerPath returns the URL path to the divider service divide HTTP endpoint.

func IntegerDivideDividerPath

func IntegerDivideDividerPath(a int, b int) string

IntegerDivideDividerPath returns the URL path to the divider service integer_divide HTTP endpoint.

func NewDivideDivByZero

func NewDivideDivByZero(body *DivideDivByZeroResponseBody) *goa.ServiceError

NewDivideDivByZero builds a divider service divide endpoint div_by_zero error.

func NewDivideTimeout

func NewDivideTimeout(body *DivideTimeoutResponseBody) *goa.ServiceError

NewDivideTimeout builds a divider service divide endpoint timeout error.

func NewIntegerDivideDivByZero

func NewIntegerDivideDivByZero(body *IntegerDivideDivByZeroResponseBody) *goa.ServiceError

NewIntegerDivideDivByZero builds a divider service integer_divide endpoint div_by_zero error.

func NewIntegerDivideHasRemainder

func NewIntegerDivideHasRemainder(body *IntegerDivideHasRemainderResponseBody) *goa.ServiceError

NewIntegerDivideHasRemainder builds a divider service integer_divide endpoint has_remainder error.

func NewIntegerDivideTimeout

func NewIntegerDivideTimeout(body *IntegerDivideTimeoutResponseBody) *goa.ServiceError

NewIntegerDivideTimeout builds a divider service integer_divide endpoint timeout error.

func ValidateDivideDivByZeroResponseBody

func ValidateDivideDivByZeroResponseBody(body *DivideDivByZeroResponseBody) (err error)

ValidateDivideDivByZeroResponseBody runs the validations defined on divide_div_by_zero_response_body

func ValidateDivideTimeoutResponseBody

func ValidateDivideTimeoutResponseBody(body *DivideTimeoutResponseBody) (err error)

ValidateDivideTimeoutResponseBody runs the validations defined on divide_timeout_response_body

func ValidateIntegerDivideDivByZeroResponseBody

func ValidateIntegerDivideDivByZeroResponseBody(body *IntegerDivideDivByZeroResponseBody) (err error)

ValidateIntegerDivideDivByZeroResponseBody runs the validations defined on integer_divide_div_by_zero_response_body

func ValidateIntegerDivideHasRemainderResponseBody

func ValidateIntegerDivideHasRemainderResponseBody(body *IntegerDivideHasRemainderResponseBody) (err error)

ValidateIntegerDivideHasRemainderResponseBody runs the validations defined on integer_divide_has_remainder_response_body

func ValidateIntegerDivideTimeoutResponseBody

func ValidateIntegerDivideTimeoutResponseBody(body *IntegerDivideTimeoutResponseBody) (err error)

ValidateIntegerDivideTimeoutResponseBody runs the validations defined on integer_divide_timeout_response_body

Types

type Client

type Client struct {
	// IntegerDivide Doer is the HTTP client used to make requests to the
	// integer_divide endpoint.
	IntegerDivideDoer goahttp.Doer

	// Divide Doer is the HTTP client used to make requests to the divide endpoint.
	DivideDoer 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 divider 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 divider service servers.

func (*Client) BuildDivideRequest

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

BuildDivideRequest instantiates a HTTP request object with method and path set to call the "divider" service "divide" endpoint

func (*Client) BuildIntegerDivideRequest

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

BuildIntegerDivideRequest instantiates a HTTP request object with method and path set to call the "divider" service "integer_divide" endpoint

func (*Client) Divide

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

Divide returns an endpoint that makes HTTP requests to the divider service divide server.

func (*Client) IntegerDivide

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

IntegerDivide returns an endpoint that makes HTTP requests to the divider service integer_divide server.

type DivideDivByZeroResponseBody

type DivideDivByZeroResponseBody 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"`
}

DivideDivByZeroResponseBody is the type of the "divider" service "divide" endpoint HTTP response body for the "div_by_zero" error.

type DivideTimeoutResponseBody

type DivideTimeoutResponseBody 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"`
}

DivideTimeoutResponseBody is the type of the "divider" service "divide" endpoint HTTP response body for the "timeout" error.

type IntegerDivideDivByZeroResponseBody

type IntegerDivideDivByZeroResponseBody 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"`
}

IntegerDivideDivByZeroResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "div_by_zero" error.

type IntegerDivideHasRemainderResponseBody

type IntegerDivideHasRemainderResponseBody 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"`
}

IntegerDivideHasRemainderResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "has_remainder" error.

type IntegerDivideTimeoutResponseBody

type IntegerDivideTimeoutResponseBody 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"`
}

IntegerDivideTimeoutResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "timeout" error.

Jump to

Keyboard shortcuts

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