Documentation
¶
Index ¶
- func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EncodeGetError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeUpdateError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeUpdateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func GetRatingPath(id uint) string
- func HandleRatingOrigin(h http.Handler) http.Handler
- func Mount(mux goahttp.Muxer, h *Server)
- func MountCORSHandler(mux goahttp.Muxer, h http.Handler)
- func MountGetHandler(mux goahttp.Muxer, h http.Handler)
- func MountUpdateHandler(mux goahttp.Muxer, h http.Handler)
- func NewCORSHandler() http.Handler
- func NewGetHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewGetPayload(id uint, token string) *rating.GetPayload
- func NewUpdateHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewUpdatePayload(body *UpdateRequestBody, id uint, token string) *rating.UpdatePayload
- func UpdateRatingPath(id uint) string
- func ValidateUpdateRequestBody(body *UpdateRequestBody) (err error)
- type ErrorNamer
- type GetInternalErrorResponseBody
- type GetInvalidScopesResponseBody
- type GetInvalidTokenResponseBody
- type GetNotFoundResponseBody
- type GetResponseBody
- type MountPoint
- type Server
- type UpdateInternalErrorResponseBody
- type UpdateInvalidScopesResponseBody
- type UpdateInvalidTokenResponseBody
- type UpdateNotFoundResponseBody
- type UpdateRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGetRequest ¶
func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeGetRequest returns a decoder for requests sent to the rating Get endpoint.
func DecodeUpdateRequest ¶
func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeUpdateRequest returns a decoder for requests sent to the rating Update endpoint.
func EncodeGetError ¶
func EncodeGetError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeGetError returns an encoder for errors returned by the Get rating endpoint.
func EncodeGetResponse ¶
func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeGetResponse returns an encoder for responses returned by the rating Get endpoint.
func EncodeUpdateError ¶
func EncodeUpdateError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeUpdateError returns an encoder for errors returned by the Update rating endpoint.
func EncodeUpdateResponse ¶
func EncodeUpdateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeUpdateResponse returns an encoder for responses returned by the rating Update endpoint.
func GetRatingPath ¶
GetRatingPath returns the URL path to the rating service Get HTTP endpoint.
func HandleRatingOrigin ¶ added in v1.8.0
HandleRatingOrigin applies the CORS response headers corresponding to the origin for the service rating.
func MountCORSHandler ¶
MountCORSHandler configures the mux to serve the CORS endpoints for the service rating.
func MountGetHandler ¶
MountGetHandler configures the mux to serve the "rating" service "Get" endpoint.
func MountUpdateHandler ¶
MountUpdateHandler configures the mux to serve the "rating" service "Update" endpoint.
func NewCORSHandler ¶
NewCORSHandler creates a HTTP handler which returns a simple 200 response.
func NewGetHandler ¶
func NewGetHandler( 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
NewGetHandler creates a HTTP handler which loads the HTTP request and calls the "rating" service "Get" endpoint.
func NewGetPayload ¶
func NewGetPayload(id uint, token string) *rating.GetPayload
NewGetPayload builds a rating service Get endpoint payload.
func NewUpdateHandler ¶
func NewUpdateHandler( 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
NewUpdateHandler creates a HTTP handler which loads the HTTP request and calls the "rating" service "Update" endpoint.
func NewUpdatePayload ¶
func NewUpdatePayload(body *UpdateRequestBody, id uint, token string) *rating.UpdatePayload
NewUpdatePayload builds a rating service Update endpoint payload.
func UpdateRatingPath ¶
UpdateRatingPath returns the URL path to the rating service Update HTTP endpoint.
func ValidateUpdateRequestBody ¶
func ValidateUpdateRequestBody(body *UpdateRequestBody) (err error)
ValidateUpdateRequestBody runs the validations defined on UpdateRequestBody
Types ¶
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 GetInternalErrorResponseBody ¶
type GetInternalErrorResponseBody 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"` }
GetInternalErrorResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "internal-error" error.
func NewGetInternalErrorResponseBody ¶
func NewGetInternalErrorResponseBody(res *goa.ServiceError) *GetInternalErrorResponseBody
NewGetInternalErrorResponseBody builds the HTTP response body from the result of the "Get" endpoint of the "rating" service.
type GetInvalidScopesResponseBody ¶
type GetInvalidScopesResponseBody 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"` }
GetInvalidScopesResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "invalid-scopes" error.
func NewGetInvalidScopesResponseBody ¶
func NewGetInvalidScopesResponseBody(res *goa.ServiceError) *GetInvalidScopesResponseBody
NewGetInvalidScopesResponseBody builds the HTTP response body from the result of the "Get" endpoint of the "rating" service.
type GetInvalidTokenResponseBody ¶
type GetInvalidTokenResponseBody 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"` }
GetInvalidTokenResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "invalid-token" error.
func NewGetInvalidTokenResponseBody ¶
func NewGetInvalidTokenResponseBody(res *goa.ServiceError) *GetInvalidTokenResponseBody
NewGetInvalidTokenResponseBody builds the HTTP response body from the result of the "Get" endpoint of the "rating" service.
type GetNotFoundResponseBody ¶
type GetNotFoundResponseBody 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"` }
GetNotFoundResponseBody is the type of the "rating" service "Get" endpoint HTTP response body for the "not-found" error.
func NewGetNotFoundResponseBody ¶
func NewGetNotFoundResponseBody(res *goa.ServiceError) *GetNotFoundResponseBody
NewGetNotFoundResponseBody builds the HTTP response body from the result of the "Get" endpoint of the "rating" service.
type GetResponseBody ¶
type GetResponseBody struct { // User rating for resource Rating int `form:"rating" json:"rating" xml:"rating"` }
GetResponseBody is the type of the "rating" service "Get" endpoint HTTP response body.
func NewGetResponseBody ¶
func NewGetResponseBody(res *rating.GetResult) *GetResponseBody
NewGetResponseBody builds the HTTP response body from the result of the "Get" endpoint of the "rating" 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 ¶
Server lists the rating service endpoint HTTP handlers.
func New ¶
func New( e *rating.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 rating 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.
type UpdateInternalErrorResponseBody ¶
type UpdateInternalErrorResponseBody 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"` }
UpdateInternalErrorResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "internal-error" error.
func NewUpdateInternalErrorResponseBody ¶
func NewUpdateInternalErrorResponseBody(res *goa.ServiceError) *UpdateInternalErrorResponseBody
NewUpdateInternalErrorResponseBody builds the HTTP response body from the result of the "Update" endpoint of the "rating" service.
type UpdateInvalidScopesResponseBody ¶
type UpdateInvalidScopesResponseBody 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"` }
UpdateInvalidScopesResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "invalid-scopes" error.
func NewUpdateInvalidScopesResponseBody ¶
func NewUpdateInvalidScopesResponseBody(res *goa.ServiceError) *UpdateInvalidScopesResponseBody
NewUpdateInvalidScopesResponseBody builds the HTTP response body from the result of the "Update" endpoint of the "rating" service.
type UpdateInvalidTokenResponseBody ¶
type UpdateInvalidTokenResponseBody 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"` }
UpdateInvalidTokenResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "invalid-token" error.
func NewUpdateInvalidTokenResponseBody ¶
func NewUpdateInvalidTokenResponseBody(res *goa.ServiceError) *UpdateInvalidTokenResponseBody
NewUpdateInvalidTokenResponseBody builds the HTTP response body from the result of the "Update" endpoint of the "rating" service.
type UpdateNotFoundResponseBody ¶
type UpdateNotFoundResponseBody 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"` }
UpdateNotFoundResponseBody is the type of the "rating" service "Update" endpoint HTTP response body for the "not-found" error.
func NewUpdateNotFoundResponseBody ¶
func NewUpdateNotFoundResponseBody(res *goa.ServiceError) *UpdateNotFoundResponseBody
NewUpdateNotFoundResponseBody builds the HTTP response body from the result of the "Update" endpoint of the "rating" service.
type UpdateRequestBody ¶
type UpdateRequestBody struct { // User rating for resource Rating *uint `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"` }
UpdateRequestBody is the type of the "rating" service "Update" endpoint HTTP request body.