Documentation ¶
Index ¶
- func DecodeDivideRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeIntegerDivideRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DivideDividerPath(a float64, b float64) string
- func EncodeDivideError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeDivideResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeIntegerDivideError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeIntegerDivideResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func IntegerDivideDividerPath(a int, b int) string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountDivideHandler(mux goahttp.Muxer, h http.Handler)
- func MountIntegerDivideHandler(mux goahttp.Muxer, h http.Handler)
- func NewDivideFloatOperands(a float64, b float64) *divider.FloatOperands
- func NewDivideHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewIntegerDivideHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewIntegerDivideIntOperands(a int, b int) *divider.IntOperands
- type DivideDivByZeroResponseBody
- type DivideTimeoutResponseBody
- type ErrorNamer
- type IntegerDivideDivByZeroResponseBody
- type IntegerDivideHasRemainderResponseBody
- type IntegerDivideTimeoutResponseBody
- type MountPoint
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeDivideRequest ¶
func DecodeDivideRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeDivideRequest returns a decoder for requests sent to the divider divide endpoint.
func DecodeIntegerDivideRequest ¶
func DecodeIntegerDivideRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeIntegerDivideRequest returns a decoder for requests sent to the divider integer_divide endpoint.
func DivideDividerPath ¶
DivideDividerPath returns the URL path to the divider service divide HTTP endpoint.
func EncodeDivideError ¶
func EncodeDivideError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeDivideError returns an encoder for errors returned by the divide divider endpoint.
func EncodeDivideResponse ¶
func EncodeDivideResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeDivideResponse returns an encoder for responses returned by the divider divide endpoint.
func EncodeIntegerDivideError ¶
func EncodeIntegerDivideError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeIntegerDivideError returns an encoder for errors returned by the integer_divide divider endpoint.
func EncodeIntegerDivideResponse ¶
func EncodeIntegerDivideResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeIntegerDivideResponse returns an encoder for responses returned by the divider integer_divide endpoint.
func IntegerDivideDividerPath ¶
IntegerDivideDividerPath returns the URL path to the divider service integer_divide HTTP endpoint.
func MountDivideHandler ¶
MountDivideHandler configures the mux to serve the "divider" service "divide" endpoint.
func MountIntegerDivideHandler ¶
MountIntegerDivideHandler configures the mux to serve the "divider" service "integer_divide" endpoint.
func NewDivideFloatOperands ¶
func NewDivideFloatOperands(a float64, b float64) *divider.FloatOperands
NewDivideFloatOperands builds a divider service divide endpoint payload.
func NewDivideHandler ¶
func NewDivideHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewDivideHandler creates a HTTP handler which loads the HTTP request and calls the "divider" service "divide" endpoint.
func NewIntegerDivideHandler ¶
func NewIntegerDivideHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewIntegerDivideHandler creates a HTTP handler which loads the HTTP request and calls the "divider" service "integer_divide" endpoint.
func NewIntegerDivideIntOperands ¶
func NewIntegerDivideIntOperands(a int, b int) *divider.IntOperands
NewIntegerDivideIntOperands builds a divider service integer_divide endpoint payload.
Types ¶
type DivideDivByZeroResponseBody ¶
type DivideDivByZeroResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` }
DivideDivByZeroResponseBody is the type of the "divider" service "divide" endpoint HTTP response body for the "div_by_zero" error.
func NewDivideDivByZeroResponseBody ¶
func NewDivideDivByZeroResponseBody(res *goa.ServiceError) *DivideDivByZeroResponseBody
NewDivideDivByZeroResponseBody builds the HTTP response body from the result of the "divide" endpoint of the "divider" service.
type DivideTimeoutResponseBody ¶
type DivideTimeoutResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` }
DivideTimeoutResponseBody is the type of the "divider" service "divide" endpoint HTTP response body for the "timeout" error.
func NewDivideTimeoutResponseBody ¶
func NewDivideTimeoutResponseBody(res *goa.ServiceError) *DivideTimeoutResponseBody
NewDivideTimeoutResponseBody builds the HTTP response body from the result of the "divide" endpoint of the "divider" service.
type ErrorNamer ¶
type ErrorNamer interface {
ErrorName() string
}
ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.
type IntegerDivideDivByZeroResponseBody ¶
type IntegerDivideDivByZeroResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` }
IntegerDivideDivByZeroResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "div_by_zero" error.
func NewIntegerDivideDivByZeroResponseBody ¶
func NewIntegerDivideDivByZeroResponseBody(res *goa.ServiceError) *IntegerDivideDivByZeroResponseBody
NewIntegerDivideDivByZeroResponseBody builds the HTTP response body from the result of the "integer_divide" endpoint of the "divider" service.
type IntegerDivideHasRemainderResponseBody ¶
type IntegerDivideHasRemainderResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` }
IntegerDivideHasRemainderResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "has_remainder" error.
func NewIntegerDivideHasRemainderResponseBody ¶
func NewIntegerDivideHasRemainderResponseBody(res *goa.ServiceError) *IntegerDivideHasRemainderResponseBody
NewIntegerDivideHasRemainderResponseBody builds the HTTP response body from the result of the "integer_divide" endpoint of the "divider" service.
type IntegerDivideTimeoutResponseBody ¶
type IntegerDivideTimeoutResponseBody struct { // Name is the name of this class of errors. Name string `form:"name" json:"name" xml:"name"` // ID is a unique identifier for this particular occurrence of the problem. ID string `form:"id" json:"id" xml:"id"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message string `form:"message" json:"message" xml:"message"` // Is the error temporary? Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` // Is the error a timeout? Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` // Is the error a server-side fault? Fault bool `form:"fault" json:"fault" xml:"fault"` }
IntegerDivideTimeoutResponseBody is the type of the "divider" service "integer_divide" endpoint HTTP response body for the "timeout" error.
func NewIntegerDivideTimeoutResponseBody ¶
func NewIntegerDivideTimeoutResponseBody(res *goa.ServiceError) *IntegerDivideTimeoutResponseBody
NewIntegerDivideTimeoutResponseBody builds the HTTP response body from the result of the "integer_divide" endpoint of the "divider" service.
type MountPoint ¶
type MountPoint struct { // Method is the name of the service method served by the mounted HTTP handler. Method string // Verb is the HTTP method used to match requests to the mounted handler. Verb string // Pattern is the HTTP request path pattern used to match requests to the // mounted handler. Pattern string }
MountPoint holds information about the mounted endpoints.
type Server ¶
type Server struct { Mounts []*MountPoint IntegerDivide http.Handler Divide http.Handler }
Server lists the divider service endpoint HTTP handlers.
func New ¶
func New( e *divider.Endpoints, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) *Server
New instantiates HTTP handlers for all the divider service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.