github.com/goadesign/goa/examples/error/gen/http/divider/client
client
import "github.com/goadesign/goa/examples/error/gen/http/divider/client"
Overview
Index
- func BuildDividePayload(dividerDivideA string, dividerDivideB string) (*dividersvc.FloatOperands, error)
- func BuildIntegerDividePayload(dividerIntegerDivideA string, dividerIntegerDivideB string) (*dividersvc.IntOperands, error)
- func DecodeDivideResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)
- func DecodeIntegerDivideResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)
- func DivideDividerPath(a float64, b float64) string
- func IntegerDivideDividerPath(a int, b int) string
- func NewDivideDivByZero(body *DivideDivByZeroResponseBody) *goa.ServiceError
- func NewDivideTimeout(body *DivideTimeoutResponseBody) *goa.ServiceError
- func NewIntegerDivideDivByZero(body *IntegerDivideDivByZeroResponseBody) *goa.ServiceError
- func NewIntegerDivideHasRemainder(body *IntegerDivideHasRemainderResponseBody) *goa.ServiceError
- func NewIntegerDivideTimeout(body *IntegerDivideTimeoutResponseBody) *goa.ServiceError
- type Client
- func NewClient(scheme string, host string, doer goahttp.Doer, enc func(*http.Request) goahttp.Encoder, dec func(*http.Response) goahttp.Decoder, restoreBody bool) *Client
- func (c *Client) BuildDivideRequest(ctx context.Context, v interface{}) (*http.Request, error)
- func (c *Client) BuildIntegerDivideRequest(ctx context.Context, v interface{}) (*http.Request, error)
- func (c *Client) Divide() goa.Endpoint
- func (c *Client) IntegerDivide() goa.Endpoint
- type DivideDivByZeroResponseBody
- type DivideTimeoutResponseBody
- type IntegerDivideDivByZeroResponseBody
- type IntegerDivideHasRemainderResponseBody
- type IntegerDivideTimeoutResponseBody
Package files
cli.go client.go encode_decode.go paths.go types.go
func BuildDividePayload
func BuildDividePayload(dividerDivideA string, dividerDivideB string) (*dividersvc.FloatOperands, error)
BuildDividePayload builds the payload for the divider divide endpoint from CLI flags.
func BuildIntegerDividePayload
func BuildIntegerDividePayload(dividerIntegerDivideA string, dividerIntegerDivideB string) (*dividersvc.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.
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.
func (*DivideDivByZeroResponseBody) Validate
func (body *DivideDivByZeroResponseBody) Validate() (err error)
Validate runs the validations defined on DivideDivByZeroResponseBody
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.
func (*DivideTimeoutResponseBody) Validate
func (body *DivideTimeoutResponseBody) Validate() (err error)
Validate runs the validations defined on DivideTimeoutResponseBody
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.
func (*IntegerDivideDivByZeroResponseBody) Validate
func (body *IntegerDivideDivByZeroResponseBody) Validate() (err error)
Validate runs the validations defined on IntegerDivideDivByZeroResponseBody
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.
func (*IntegerDivideHasRemainderResponseBody) Validate
func (body *IntegerDivideHasRemainderResponseBody) Validate() (err error)
Validate runs the validations defined on IntegerDivideHasRemainderResponseBody
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.
func (*IntegerDivideTimeoutResponseBody) Validate
func (body *IntegerDivideTimeoutResponseBody) Validate() (err error)
Validate runs the validations defined on IntegerDivideTimeoutResponseBody
Generated by godoc2md