Documentation
¶
Index ¶
- func DecodeFollowRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeFollowersRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeUnfollowRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EncodeFollowError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeFollowResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeFollowersError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeFollowersResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeUnfollowError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, ...) func(context.Context, http.ResponseWriter, error) error
- func EncodeUnfollowResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func FollowFollowingPath(id int64) string
- func FollowersFollowingPath(id int64) string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountCORSHandler(mux goahttp.Muxer, h http.Handler)
- func MountFollowHandler(mux goahttp.Muxer, h http.Handler)
- func MountFollowersHandler(mux goahttp.Muxer, h http.Handler)
- func MountUnfollowHandler(mux goahttp.Muxer, h http.Handler)
- func NewCORSHandler() http.Handler
- func NewFollowHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewFollowPayload(id int64, auth *string) *following.FollowPayload
- func NewFollowersHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewFollowersPayload(id int64, page *int64) *following.FollowersPayload
- func NewUnfollowHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewUnfollowPayload(id int64, auth *string) *following.UnfollowPayload
- func UnfollowFollowingPath(id int64) string
- type AvatarResponseBody
- type ErrorNamer
- type FollowBadRequestResponseBody
- type FollowForbiddenResponseBody
- type FollowNotFoundResponseBody
- type FollowUnauthorizedResponseBody
- type FollowerResponseBody
- type FollowerResponseBodyCollection
- type FollowersBadRequestResponseBody
- type FollowersForbiddenResponseBody
- type FollowersNotFoundResponseBody
- type FollowersResponseBody
- type FollowersUnauthorizedResponseBody
- type MountPoint
- type Server
- type UnfollowBadRequestResponseBody
- type UnfollowForbiddenResponseBody
- type UnfollowNotFoundResponseBody
- type UnfollowUnauthorizedResponseBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFollowRequest ¶
func DecodeFollowRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeFollowRequest returns a decoder for requests sent to the following follow endpoint.
func DecodeFollowersRequest ¶
func DecodeFollowersRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeFollowersRequest returns a decoder for requests sent to the following followers endpoint.
func DecodeUnfollowRequest ¶
func DecodeUnfollowRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeUnfollowRequest returns a decoder for requests sent to the following unfollow endpoint.
func EncodeFollowError ¶
func EncodeFollowError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeFollowError returns an encoder for errors returned by the follow following endpoint.
func EncodeFollowResponse ¶
func EncodeFollowResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeFollowResponse returns an encoder for responses returned by the following follow endpoint.
func EncodeFollowersError ¶
func EncodeFollowersError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeFollowersError returns an encoder for errors returned by the followers following endpoint.
func EncodeFollowersResponse ¶
func EncodeFollowersResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeFollowersResponse returns an encoder for responses returned by the following followers endpoint.
func EncodeUnfollowError ¶
func EncodeUnfollowError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error
EncodeUnfollowError returns an encoder for errors returned by the unfollow following endpoint.
func EncodeUnfollowResponse ¶
func EncodeUnfollowResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeUnfollowResponse returns an encoder for responses returned by the following unfollow endpoint.
func FollowFollowingPath ¶
FollowFollowingPath returns the URL path to the following service follow HTTP endpoint.
func FollowersFollowingPath ¶
FollowersFollowingPath returns the URL path to the following service followers HTTP endpoint.
func MountCORSHandler ¶
MountCORSHandler configures the mux to serve the CORS endpoints for the service following.
func MountFollowHandler ¶
MountFollowHandler configures the mux to serve the "following" service "follow" endpoint.
func MountFollowersHandler ¶
MountFollowersHandler configures the mux to serve the "following" service "followers" endpoint.
func MountUnfollowHandler ¶
MountUnfollowHandler configures the mux to serve the "following" service "unfollow" endpoint.
func NewCORSHandler ¶
NewCORSHandler creates a HTTP handler which returns a simple 200 response.
func NewFollowHandler ¶
func NewFollowHandler( 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
NewFollowHandler creates a HTTP handler which loads the HTTP request and calls the "following" service "follow" endpoint.
func NewFollowPayload ¶
func NewFollowPayload(id int64, auth *string) *following.FollowPayload
NewFollowPayload builds a following service follow endpoint payload.
func NewFollowersHandler ¶
func NewFollowersHandler( 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
NewFollowersHandler creates a HTTP handler which loads the HTTP request and calls the "following" service "followers" endpoint.
func NewFollowersPayload ¶
func NewFollowersPayload(id int64, page *int64) *following.FollowersPayload
NewFollowersPayload builds a following service followers endpoint payload.
func NewUnfollowHandler ¶
func NewUnfollowHandler( 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
NewUnfollowHandler creates a HTTP handler which loads the HTTP request and calls the "following" service "unfollow" endpoint.
func NewUnfollowPayload ¶
func NewUnfollowPayload(id int64, auth *string) *following.UnfollowPayload
NewUnfollowPayload builds a following service unfollow endpoint payload.
func UnfollowFollowingPath ¶
UnfollowFollowingPath returns the URL path to the following service unfollow HTTP endpoint.
Types ¶
type AvatarResponseBody ¶
type AvatarResponseBody struct {
URL string `form:"url" json:"url" xml:"url"`
}
AvatarResponseBody is used to define fields on response body 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 FollowBadRequestResponseBody ¶
type FollowBadRequestResponseBody 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"` }
FollowBadRequestResponseBody is the type of the "following" service "follow" endpoint HTTP response body for the "bad-request" error.
func NewFollowBadRequestResponseBody ¶
func NewFollowBadRequestResponseBody(res *goa.ServiceError) *FollowBadRequestResponseBody
NewFollowBadRequestResponseBody builds the HTTP response body from the result of the "follow" endpoint of the "following" service.
type FollowForbiddenResponseBody ¶
type FollowForbiddenResponseBody 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"` }
FollowForbiddenResponseBody is the type of the "following" service "follow" endpoint HTTP response body for the "forbidden" error.
func NewFollowForbiddenResponseBody ¶
func NewFollowForbiddenResponseBody(res *goa.ServiceError) *FollowForbiddenResponseBody
NewFollowForbiddenResponseBody builds the HTTP response body from the result of the "follow" endpoint of the "following" service.
type FollowNotFoundResponseBody ¶
type FollowNotFoundResponseBody 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"` }
FollowNotFoundResponseBody is the type of the "following" service "follow" endpoint HTTP response body for the "not-found" error.
func NewFollowNotFoundResponseBody ¶
func NewFollowNotFoundResponseBody(res *goa.ServiceError) *FollowNotFoundResponseBody
NewFollowNotFoundResponseBody builds the HTTP response body from the result of the "follow" endpoint of the "following" service.
type FollowUnauthorizedResponseBody ¶
type FollowUnauthorizedResponseBody struct { string `form:"name" json:"name" xml:"name"` ID string `form:"id" json:"id" xml:"id"` // problem. Message string `form:"message" json:"message" xml:"message"` Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` Fault bool `form:"fault" json:"fault" xml:"fault"` }Name
FollowUnauthorizedResponseBody is the type of the "following" service "follow" endpoint HTTP response body for the "unauthorized" error.
func NewFollowUnauthorizedResponseBody ¶
func NewFollowUnauthorizedResponseBody(res *goa.ServiceError) *FollowUnauthorizedResponseBody
NewFollowUnauthorizedResponseBody builds the HTTP response body from the result of the "follow" endpoint of the "following" service.
type FollowerResponseBody ¶
type FollowerResponseBody struct { ID int64 `form:"id" json:"id" xml:"id"` Name string `form:"name" json:"name" xml:"name"` Avatar *AvatarResponseBody `form:"avatar,omitempty" json:"avatar,omitempty" xml:"avatar,omitempty"` }
FollowerResponseBody is used to define fields on response body types.
type FollowerResponseBodyCollection ¶
type FollowerResponseBodyCollection []*FollowerResponseBody
FollowerResponseBodyCollection is used to define fields on response body types.
type FollowersBadRequestResponseBody ¶
type FollowersBadRequestResponseBody 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"` }
FollowersBadRequestResponseBody is the type of the "following" service "followers" endpoint HTTP response body for the "bad-request" error.
func NewFollowersBadRequestResponseBody ¶
func NewFollowersBadRequestResponseBody(res *goa.ServiceError) *FollowersBadRequestResponseBody
NewFollowersBadRequestResponseBody builds the HTTP response body from the result of the "followers" endpoint of the "following" service.
type FollowersForbiddenResponseBody ¶
type FollowersForbiddenResponseBody 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"` }
FollowersForbiddenResponseBody is the type of the "following" service "followers" endpoint HTTP response body for the "forbidden" error.
func NewFollowersForbiddenResponseBody ¶
func NewFollowersForbiddenResponseBody(res *goa.ServiceError) *FollowersForbiddenResponseBody
NewFollowersForbiddenResponseBody builds the HTTP response body from the result of the "followers" endpoint of the "following" service.
type FollowersNotFoundResponseBody ¶
type FollowersNotFoundResponseBody 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"` }
FollowersNotFoundResponseBody is the type of the "following" service "followers" endpoint HTTP response body for the "not-found" error.
func NewFollowersNotFoundResponseBody ¶
func NewFollowersNotFoundResponseBody(res *goa.ServiceError) *FollowersNotFoundResponseBody
NewFollowersNotFoundResponseBody builds the HTTP response body from the result of the "followers" endpoint of the "following" service.
type FollowersResponseBody ¶
type FollowersResponseBody struct { Followers FollowerResponseBodyCollection `form:"followers" json:"followers" xml:"followers"` Total int32 `form:"total" json:"total" xml:"total"` Page int32 `form:"page" json:"page" xml:"page"` }
FollowersResponseBody is the type of the "following" service "followers" endpoint HTTP response body.
func NewFollowersResponseBody ¶
func NewFollowersResponseBody(res *followingviews.FollowersPageView) *FollowersResponseBody
NewFollowersResponseBody builds the HTTP response body from the result of the "followers" endpoint of the "following" service.
type FollowersUnauthorizedResponseBody ¶
type FollowersUnauthorizedResponseBody struct { string `form:"name" json:"name" xml:"name"` ID string `form:"id" json:"id" xml:"id"` // problem. Message string `form:"message" json:"message" xml:"message"` Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` Fault bool `form:"fault" json:"fault" xml:"fault"` }Name
FollowersUnauthorizedResponseBody is the type of the "following" service "followers" endpoint HTTP response body for the "unauthorized" error.
func NewFollowersUnauthorizedResponseBody ¶
func NewFollowersUnauthorizedResponseBody(res *goa.ServiceError) *FollowersUnauthorizedResponseBody
NewFollowersUnauthorizedResponseBody builds the HTTP response body from the result of the "followers" endpoint of the "following" 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 Follow http.Handler Unfollow http.Handler Followers http.Handler CORS http.Handler }
Server lists the following service endpoint HTTP handlers.
func New ¶
func New( e *following.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 following 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 UnfollowBadRequestResponseBody ¶
type UnfollowBadRequestResponseBody 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"` }
UnfollowBadRequestResponseBody is the type of the "following" service "unfollow" endpoint HTTP response body for the "bad-request" error.
func NewUnfollowBadRequestResponseBody ¶
func NewUnfollowBadRequestResponseBody(res *goa.ServiceError) *UnfollowBadRequestResponseBody
NewUnfollowBadRequestResponseBody builds the HTTP response body from the result of the "unfollow" endpoint of the "following" service.
type UnfollowForbiddenResponseBody ¶
type UnfollowForbiddenResponseBody 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"` }
UnfollowForbiddenResponseBody is the type of the "following" service "unfollow" endpoint HTTP response body for the "forbidden" error.
func NewUnfollowForbiddenResponseBody ¶
func NewUnfollowForbiddenResponseBody(res *goa.ServiceError) *UnfollowForbiddenResponseBody
NewUnfollowForbiddenResponseBody builds the HTTP response body from the result of the "unfollow" endpoint of the "following" service.
type UnfollowNotFoundResponseBody ¶
type UnfollowNotFoundResponseBody 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"` }
UnfollowNotFoundResponseBody is the type of the "following" service "unfollow" endpoint HTTP response body for the "not-found" error.
func NewUnfollowNotFoundResponseBody ¶
func NewUnfollowNotFoundResponseBody(res *goa.ServiceError) *UnfollowNotFoundResponseBody
NewUnfollowNotFoundResponseBody builds the HTTP response body from the result of the "unfollow" endpoint of the "following" service.
type UnfollowUnauthorizedResponseBody ¶
type UnfollowUnauthorizedResponseBody struct { string `form:"name" json:"name" xml:"name"` ID string `form:"id" json:"id" xml:"id"` // problem. Message string `form:"message" json:"message" xml:"message"` Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` Fault bool `form:"fault" json:"fault" xml:"fault"` }Name
UnfollowUnauthorizedResponseBody is the type of the "following" service "unfollow" endpoint HTTP response body for the "unauthorized" error.
func NewUnfollowUnauthorizedResponseBody ¶
func NewUnfollowUnauthorizedResponseBody(res *goa.ServiceError) *UnfollowUnauthorizedResponseBody
NewUnfollowUnauthorizedResponseBody builds the HTTP response body from the result of the "unfollow" endpoint of the "following" service.