github.com/goadesign/goa/examples/chatter/gen/http/chatter/server
server
import "github.com/goadesign/goa/examples/chatter/gen/http/chatter/server"
Overview
Index
- func DecodeEchoerRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeHistoryRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeListenerRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeLoginRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeSummaryRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EchoerChatterPath() string
- func EncodeEchoerError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
- func EncodeHistoryError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
- func EncodeListenerError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
- func EncodeLoginError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
- func EncodeLoginResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeSummaryError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
- func HistoryChatterPath() string
- func ListenerChatterPath() string
- func LoginChatterPath() string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountEchoerHandler(mux goahttp.Muxer, h http.Handler)
- func MountHistoryHandler(mux goahttp.Muxer, h http.Handler)
- func MountListenerHandler(mux goahttp.Muxer, h http.Handler)
- func MountLoginHandler(mux goahttp.Muxer, h http.Handler)
- func MountSummaryHandler(mux goahttp.Muxer, h http.Handler)
- func NewEchoerHandler(endpoint goa.Endpoint, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error), up goahttp.Upgrader, connConfigFn goahttp.ConnConfigureFunc) http.Handler
- func NewEchoerPayload(token string) *chattersvc.EchoerPayload
- func NewHistoryHandler(endpoint goa.Endpoint, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error), up goahttp.Upgrader, connConfigFn goahttp.ConnConfigureFunc) http.Handler
- func NewHistoryPayload(view *string, token string) *chattersvc.HistoryPayload
- func NewListenerHandler(endpoint goa.Endpoint, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error), up goahttp.Upgrader, connConfigFn goahttp.ConnConfigureFunc) http.Handler
- func NewListenerPayload(token string) *chattersvc.ListenerPayload
- func NewLoginHandler(endpoint goa.Endpoint, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error)) http.Handler
- func NewLoginPayload() *chattersvc.LoginPayload
- func NewSummaryHandler(endpoint goa.Endpoint, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error), up goahttp.Upgrader, connConfigFn goahttp.ConnConfigureFunc) http.Handler
- func NewSummaryPayload(token string) *chattersvc.SummaryPayload
- func SummaryChatterPath() string
- type ChatSummaryResponseBody
- type ChatSummaryResponseBodyCollection
- type EchoerInvalidScopesResponseBody
- type EchoerUnauthorizedResponseBody
- type ErrorNamer
- type HistoryInvalidScopesResponseBody
- type HistoryResponseBody
- type HistoryResponseBodyTiny
- type HistoryUnauthorizedResponseBody
- type ListenerInvalidScopesResponseBody
- type ListenerUnauthorizedResponseBody
- type LoginUnauthorizedResponseBody
- type MountPoint
- type Server
- func New(e *chattersvc.Endpoints, mux goahttp.Muxer, dec func(*http.Request) goahttp.Decoder, enc func(context.Context, http.ResponseWriter) goahttp.Encoder, eh func(context.Context, http.ResponseWriter, error), up goahttp.Upgrader, connConfigFn goahttp.ConnConfigureFunc) *Server
- func (s *Server) Service() string
- func (s *Server) Use(m func(http.Handler) http.Handler)
- type SummaryInvalidScopesResponseBody
- type SummaryUnauthorizedResponseBody
Package files
encode_decode.go paths.go server.go types.go
func DecodeEchoerRequest
func DecodeEchoerRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeEchoerRequest returns a decoder for requests sent to the chatter echoer endpoint.
func DecodeHistoryRequest
func DecodeHistoryRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeHistoryRequest returns a decoder for requests sent to the chatter history endpoint.
func DecodeListenerRequest
func DecodeListenerRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeListenerRequest returns a decoder for requests sent to the chatter listener endpoint.
func DecodeLoginRequest
func DecodeLoginRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeLoginRequest returns a decoder for requests sent to the chatter login endpoint.
func DecodeSummaryRequest
func DecodeSummaryRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeSummaryRequest returns a decoder for requests sent to the chatter summary endpoint.
func EchoerChatterPath
func EchoerChatterPath() string
EchoerChatterPath returns the URL path to the chatter service echoer HTTP endpoint.
func EncodeEchoerError
func EncodeEchoerError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
EncodeEchoerError returns an encoder for errors returned by the echoer chatter endpoint.
func EncodeHistoryError
func EncodeHistoryError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
EncodeHistoryError returns an encoder for errors returned by the history chatter endpoint.
func EncodeListenerError
func EncodeListenerError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
EncodeListenerError returns an encoder for errors returned by the listener chatter endpoint.
func EncodeLoginError
func EncodeLoginError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
EncodeLoginError returns an encoder for errors returned by the login chatter endpoint.
func EncodeLoginResponse
func EncodeLoginResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeLoginResponse returns an encoder for responses returned by the chatter login endpoint.
func EncodeSummaryError
func EncodeSummaryError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error
EncodeSummaryError returns an encoder for errors returned by the summary chatter endpoint.
func HistoryChatterPath
func HistoryChatterPath() string
HistoryChatterPath returns the URL path to the chatter service history HTTP endpoint.
func ListenerChatterPath
func ListenerChatterPath() string
ListenerChatterPath returns the URL path to the chatter service listener HTTP endpoint.
func LoginChatterPath
func LoginChatterPath() string
LoginChatterPath returns the URL path to the chatter service login HTTP endpoint.
func Mount
func Mount(mux goahttp.Muxer, h *Server)
Mount configures the mux to serve the chatter endpoints.
func MountEchoerHandler
func MountEchoerHandler(mux goahttp.Muxer, h http.Handler)
MountEchoerHandler configures the mux to serve the “chatter” service “echoer” endpoint.
func MountHistoryHandler
func MountHistoryHandler(mux goahttp.Muxer, h http.Handler)
MountHistoryHandler configures the mux to serve the “chatter” service “history” endpoint.
func MountListenerHandler
func MountListenerHandler(mux goahttp.Muxer, h http.Handler)
MountListenerHandler configures the mux to serve the “chatter” service “listener” endpoint.
func MountLoginHandler
func MountLoginHandler(mux goahttp.Muxer, h http.Handler)
MountLoginHandler configures the mux to serve the “chatter” service “login” endpoint.
func MountSummaryHandler
func MountSummaryHandler(mux goahttp.Muxer, h http.Handler)
MountSummaryHandler configures the mux to serve the “chatter” service “summary” endpoint.
func NewEchoerHandler
func NewEchoerHandler(
endpoint goa.Endpoint,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
up goahttp.Upgrader,
connConfigFn goahttp.ConnConfigureFunc,
) http.Handler
NewEchoerHandler creates a HTTP handler which loads the HTTP request and calls the “chatter” service “echoer” endpoint.
func NewEchoerPayload
func NewEchoerPayload(token string) *chattersvc.EchoerPayload
NewEchoerPayload builds a chatter service echoer endpoint payload.
func NewHistoryHandler
func NewHistoryHandler(
endpoint goa.Endpoint,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
up goahttp.Upgrader,
connConfigFn goahttp.ConnConfigureFunc,
) http.Handler
NewHistoryHandler creates a HTTP handler which loads the HTTP request and calls the “chatter” service “history” endpoint.
func NewHistoryPayload
func NewHistoryPayload(view *string, token string) *chattersvc.HistoryPayload
NewHistoryPayload builds a chatter service history endpoint payload.
func NewListenerHandler
func NewListenerHandler(
endpoint goa.Endpoint,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
up goahttp.Upgrader,
connConfigFn goahttp.ConnConfigureFunc,
) http.Handler
NewListenerHandler creates a HTTP handler which loads the HTTP request and calls the “chatter” service “listener” endpoint.
func NewListenerPayload
func NewListenerPayload(token string) *chattersvc.ListenerPayload
NewListenerPayload builds a chatter service listener endpoint payload.
func NewLoginHandler
func NewLoginHandler(
endpoint goa.Endpoint,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
) http.Handler
NewLoginHandler creates a HTTP handler which loads the HTTP request and calls the “chatter” service “login” endpoint.
func NewLoginPayload
func NewLoginPayload() *chattersvc.LoginPayload
NewLoginPayload builds a chatter service login endpoint payload.
func NewSummaryHandler
func NewSummaryHandler(
endpoint goa.Endpoint,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
up goahttp.Upgrader,
connConfigFn goahttp.ConnConfigureFunc,
) http.Handler
NewSummaryHandler creates a HTTP handler which loads the HTTP request and calls the “chatter” service “summary” endpoint.
func NewSummaryPayload
func NewSummaryPayload(token string) *chattersvc.SummaryPayload
NewSummaryPayload builds a chatter service summary endpoint payload.
func SummaryChatterPath
func SummaryChatterPath() string
SummaryChatterPath returns the URL path to the chatter service summary HTTP endpoint.
type ChatSummaryResponseBody
type ChatSummaryResponseBody struct {
// Message sent to the server
Message string `form:"message" json:"message" xml:"message"`
// Length of the message sent
Length *int `form:"length,omitempty" json:"length,omitempty" xml:"length,omitempty"`
// Time at which the message was sent
SentAt *string `form:"sent_at,omitempty" json:"sent_at,omitempty" xml:"sent_at,omitempty"`
}
ChatSummaryResponseBody is used to define fields on response body types.
func (*ChatSummaryResponseBody) Validate
func (body *ChatSummaryResponseBody) Validate() (err error)
Validate runs the validations defined on ChatSummaryResponseBody
type ChatSummaryResponseBodyCollection
type ChatSummaryResponseBodyCollection []*ChatSummaryResponseBody
ChatSummaryResponseBodyCollection is the type of the “chatter” service “summary” endpoint HTTP response body.
func NewChatSummaryResponseBodyCollection
func NewChatSummaryResponseBodyCollection(res chattersvcviews.ChatSummaryCollectionView) ChatSummaryResponseBodyCollection
NewChatSummaryResponseBodyCollection builds the HTTP response body from the result of the “summary” endpoint of the “chatter” service.
type EchoerInvalidScopesResponseBody
type EchoerInvalidScopesResponseBody string
EchoerInvalidScopesResponseBody is the type of the “chatter” service “echoer” endpoint HTTP response body for the “invalid-scopes” error.
func NewEchoerInvalidScopesResponseBody
func NewEchoerInvalidScopesResponseBody(res chattersvc.InvalidScopes) EchoerInvalidScopesResponseBody
NewEchoerInvalidScopesResponseBody builds the HTTP response body from the result of the “echoer” endpoint of the “chatter” service.
type EchoerUnauthorizedResponseBody
type EchoerUnauthorizedResponseBody string
EchoerUnauthorizedResponseBody is the type of the “chatter” service “echoer” endpoint HTTP response body for the “unauthorized” error.
func NewEchoerUnauthorizedResponseBody
func NewEchoerUnauthorizedResponseBody(res chattersvc.Unauthorized) EchoerUnauthorizedResponseBody
NewEchoerUnauthorizedResponseBody builds the HTTP response body from the result of the “echoer” endpoint of the “chatter” 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 HistoryInvalidScopesResponseBody
type HistoryInvalidScopesResponseBody string
HistoryInvalidScopesResponseBody is the type of the “chatter” service “history” endpoint HTTP response body for the “invalid-scopes” error.
func NewHistoryInvalidScopesResponseBody
func NewHistoryInvalidScopesResponseBody(res chattersvc.InvalidScopes) HistoryInvalidScopesResponseBody
NewHistoryInvalidScopesResponseBody builds the HTTP response body from the result of the “history” endpoint of the “chatter” service.
type HistoryResponseBody
type HistoryResponseBody struct {
// Message sent to the server
Message string `form:"message" json:"message" xml:"message"`
// Length of the message sent
Length *int `form:"length,omitempty" json:"length,omitempty" xml:"length,omitempty"`
// Time at which the message was sent
SentAt *string `form:"sent_at,omitempty" json:"sent_at,omitempty" xml:"sent_at,omitempty"`
}
HistoryResponseBody is the type of the “chatter” service “history” endpoint HTTP response body.
func NewHistoryResponseBody
func NewHistoryResponseBody(res *chattersvcviews.ChatSummaryView) *HistoryResponseBody
NewHistoryResponseBody builds the HTTP response body from the result of the “history” endpoint of the “chatter” service.
type HistoryResponseBodyTiny
type HistoryResponseBodyTiny struct {
// Message sent to the server
Message string `form:"message" json:"message" xml:"message"`
}
HistoryResponseBodyTiny is the type of the “chatter” service “history” endpoint HTTP response body.
func NewHistoryResponseBodyTiny
func NewHistoryResponseBodyTiny(res *chattersvcviews.ChatSummaryView) *HistoryResponseBodyTiny
NewHistoryResponseBodyTiny builds the HTTP response body from the result of the “history” endpoint of the “chatter” service.
type HistoryUnauthorizedResponseBody
type HistoryUnauthorizedResponseBody string
HistoryUnauthorizedResponseBody is the type of the “chatter” service “history” endpoint HTTP response body for the “unauthorized” error.
func NewHistoryUnauthorizedResponseBody
func NewHistoryUnauthorizedResponseBody(res chattersvc.Unauthorized) HistoryUnauthorizedResponseBody
NewHistoryUnauthorizedResponseBody builds the HTTP response body from the result of the “history” endpoint of the “chatter” service.
type ListenerInvalidScopesResponseBody
type ListenerInvalidScopesResponseBody string
ListenerInvalidScopesResponseBody is the type of the “chatter” service “listener” endpoint HTTP response body for the “invalid-scopes” error.
func NewListenerInvalidScopesResponseBody
func NewListenerInvalidScopesResponseBody(res chattersvc.InvalidScopes) ListenerInvalidScopesResponseBody
NewListenerInvalidScopesResponseBody builds the HTTP response body from the result of the “listener” endpoint of the “chatter” service.
type ListenerUnauthorizedResponseBody
type ListenerUnauthorizedResponseBody string
ListenerUnauthorizedResponseBody is the type of the “chatter” service “listener” endpoint HTTP response body for the “unauthorized” error.
func NewListenerUnauthorizedResponseBody
func NewListenerUnauthorizedResponseBody(res chattersvc.Unauthorized) ListenerUnauthorizedResponseBody
NewListenerUnauthorizedResponseBody builds the HTTP response body from the result of the “listener” endpoint of the “chatter” service.
type LoginUnauthorizedResponseBody
type LoginUnauthorizedResponseBody string
LoginUnauthorizedResponseBody is the type of the “chatter” service “login” endpoint HTTP response body for the “unauthorized” error.
func NewLoginUnauthorizedResponseBody
func NewLoginUnauthorizedResponseBody(res chattersvc.Unauthorized) LoginUnauthorizedResponseBody
NewLoginUnauthorizedResponseBody builds the HTTP response body from the result of the “login” endpoint of the “chatter” 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
Login http.Handler
Echoer http.Handler
Listener http.Handler
Summary http.Handler
History http.Handler
}
Server lists the chatter service endpoint HTTP handlers.
func New
func New(
e *chattersvc.Endpoints,
mux goahttp.Muxer,
dec func(*http.Request) goahttp.Decoder,
enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
eh func(context.Context, http.ResponseWriter, error),
up goahttp.Upgrader,
connConfigFn goahttp.ConnConfigureFunc,
) *Server
New instantiates HTTP handlers for all the chatter service endpoints.
func (*Server) Service
func (s *Server) Service() string
Service returns the name of the service served.
func (*Server) Use
func (s *Server) Use(m func(http.Handler) http.Handler)
Use wraps the server handlers with the given middleware.
type SummaryInvalidScopesResponseBody
type SummaryInvalidScopesResponseBody string
SummaryInvalidScopesResponseBody is the type of the “chatter” service “summary” endpoint HTTP response body for the “invalid-scopes” error.
func NewSummaryInvalidScopesResponseBody
func NewSummaryInvalidScopesResponseBody(res chattersvc.InvalidScopes) SummaryInvalidScopesResponseBody
NewSummaryInvalidScopesResponseBody builds the HTTP response body from the result of the “summary” endpoint of the “chatter” service.
type SummaryUnauthorizedResponseBody
type SummaryUnauthorizedResponseBody string
SummaryUnauthorizedResponseBody is the type of the “chatter” service “summary” endpoint HTTP response body for the “unauthorized” error.
func NewSummaryUnauthorizedResponseBody
func NewSummaryUnauthorizedResponseBody(res chattersvc.Unauthorized) SummaryUnauthorizedResponseBody
NewSummaryUnauthorizedResponseBody builds the HTTP response body from the result of the “summary” endpoint of the “chatter” service.
Generated by godoc2md