Documentation ¶
Index ¶
- func DecodeFindRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeListAllRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EncodeFindResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeListAllResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func FindIncidentsPath(id uint64) string
- func ListAllIncidentsPath() string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountFindHandler(mux goahttp.Muxer, h http.Handler)
- func MountListAllHandler(mux goahttp.Muxer, h http.Handler)
- func NewFindHandler(endpoint endpoint.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewFindPayload(id uint64) *incidents.FindPayload
- func NewListAllHandler(endpoint endpoint.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewListAllLimitPayload(limit *int32) *incidents.LimitPayload
- type ErrorNamer
- type FindResponseBody
- type IncidentResponse
- type ListAllResponseBody
- type MountPoint
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFindRequest ¶
func DecodeFindRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeFindRequest returns a decoder for requests sent to the incidents find endpoint.
func DecodeListAllRequest ¶
func DecodeListAllRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeListAllRequest returns a decoder for requests sent to the incidents list all endpoint.
func EncodeFindResponse ¶
func EncodeFindResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeFindResponse returns an encoder for responses returned by the incidents find endpoint.
func EncodeListAllResponse ¶
func EncodeListAllResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeListAllResponse returns an encoder for responses returned by the incidents list all endpoint.
func FindIncidentsPath ¶
FindIncidentsPath returns the URL path to the incidents service find HTTP endpoint.
func ListAllIncidentsPath ¶
func ListAllIncidentsPath() string
ListAllIncidentsPath returns the URL path to the incidents service list all HTTP endpoint.
func MountFindHandler ¶
MountFindHandler configures the mux to serve the "incidents" service "find" endpoint.
func MountListAllHandler ¶
MountListAllHandler configures the mux to serve the "incidents" service "list all" endpoint.
func NewFindHandler ¶
func NewFindHandler( endpoint endpoint.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
NewFindHandler creates a HTTP handler which loads the HTTP request and calls the "incidents" service "find" endpoint.
func NewFindPayload ¶
func NewFindPayload(id uint64) *incidents.FindPayload
NewFindPayload builds a incidents service find endpoint payload.
func NewListAllHandler ¶
func NewListAllHandler( endpoint endpoint.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
NewListAllHandler creates a HTTP handler which loads the HTTP request and calls the "incidents" service "list all" endpoint.
func NewListAllLimitPayload ¶
func NewListAllLimitPayload(limit *int32) *incidents.LimitPayload
NewListAllLimitPayload builds a incidents service list all endpoint payload.
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 FindResponseBody ¶
type FindResponseBody struct { // Unique ID of the incident ID *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` // Date the incident occurred Date *string `form:"date,omitempty" json:"date,omitempty" xml:"date,omitempty"` // Date the incident occurred DateClosed *string `form:"date_closed,omitempty" json:"date_closed,omitempty" xml:"date_closed,omitempty"` // Permissions associated with incident Permissions *string `form:"Permissions,omitempty" json:"Permissions,omitempty" xml:"Permissions,omitempty"` // The severity of the incident Severity *int `form:"severity,omitempty" json:"severity,omitempty" xml:"severity,omitempty"` // The short title of the incident Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"` // The detailed description of the incident Summary *string `form:"summary,omitempty" json:"summary,omitempty" xml:"summary,omitempty"` // The scope of impact of this incident Scope *string `form:"scope,omitempty" json:"scope,omitempty" xml:"scope,omitempty"` // What group or individual caused the initial incident ResponsibleParty *string `form:"responsible_party,omitempty" json:"responsible_party,omitempty" xml:"responsible_party,omitempty"` // A list of the affected customers AffectedCustomers []string `form:"affected_customers,omitempty" json:"affected_customers,omitempty" xml:"affected_customers,omitempty"` // The original cause of the incident RootCause *string `form:"root_cause,omitempty" json:"root_cause,omitempty" xml:"root_cause,omitempty"` // The slack channel for incident discussions SlackChannel *string `form:"slack_channel,omitempty" json:"slack_channel,omitempty" xml:"slack_channel,omitempty"` // When the incident was submitted CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"` // When the incident was last updated UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"` }
FindResponseBody is the type of the "incidents" service "find" endpoint HTTP response body.
func NewFindResponseBody ¶
func NewFindResponseBody(res *incidents.Incident) *FindResponseBody
NewFindResponseBody builds the HTTP response body from the result of the "find" endpoint of the "incidents" service.
type IncidentResponse ¶
type IncidentResponse struct { // Unique ID of the incident ID *uint64 `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` // Date the incident occurred Date *string `form:"date,omitempty" json:"date,omitempty" xml:"date,omitempty"` // Date the incident occurred DateClosed *string `form:"date_closed,omitempty" json:"date_closed,omitempty" xml:"date_closed,omitempty"` // Permissions associated with incident Permissions *string `form:"Permissions,omitempty" json:"Permissions,omitempty" xml:"Permissions,omitempty"` // The severity of the incident Severity *int `form:"severity,omitempty" json:"severity,omitempty" xml:"severity,omitempty"` // The short title of the incident Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"` // The detailed description of the incident Summary *string `form:"summary,omitempty" json:"summary,omitempty" xml:"summary,omitempty"` // The scope of impact of this incident Scope *string `form:"scope,omitempty" json:"scope,omitempty" xml:"scope,omitempty"` // What group or individual caused the initial incident ResponsibleParty *string `form:"responsible_party,omitempty" json:"responsible_party,omitempty" xml:"responsible_party,omitempty"` // A list of the affected customers AffectedCustomers []string `form:"affected_customers,omitempty" json:"affected_customers,omitempty" xml:"affected_customers,omitempty"` // The original cause of the incident RootCause *string `form:"root_cause,omitempty" json:"root_cause,omitempty" xml:"root_cause,omitempty"` // The slack channel for incident discussions SlackChannel *string `form:"slack_channel,omitempty" json:"slack_channel,omitempty" xml:"slack_channel,omitempty"` // When the incident was submitted CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"` // When the incident was last updated UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"` }
IncidentResponse is used to define fields on response body types.
type ListAllResponseBody ¶
type ListAllResponseBody []*IncidentResponse
ListAllResponseBody is the type of the "incidents" service "list all" endpoint HTTP response body.
func NewListAllResponseBody ¶
func NewListAllResponseBody(res []*incidents.Incident) ListAllResponseBody
NewListAllResponseBody builds the HTTP response body from the result of the "list all" endpoint of the "incidents" 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 Find http.Handler ListAll http.Handler }
Server lists the incidents service endpoint HTTP handlers.
func New ¶
func New( e *incidents.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 incidents 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.