Documentation ¶
Index ¶
- func MakeCreateMessageEndpoint(service messaging.Service) endpoint.Endpoint
- func MakeGRPCServer(endpoints Endpoints, options ...kitgrpc.ServerOption) messagingv1.MessageListKitServer
- func MakeGetMessageEndpoint(service messaging.Service) endpoint.Endpoint
- func MakeGraphQLHandler(endpoints Endpoints, errorHandler messaging.ErrorHandler) http.Handler
- func MakeListMessagesEndpoint(service messaging.Service) endpoint.Endpoint
- func RegisterHTTPHandlers(endpoints Endpoints, router *mux.Router, options ...kithttp.ServerOption)
- func RegisterWebSocketHandlers(router *mux.Router, subscriber message.Subscriber)
- func ServeWS(w http.ResponseWriter, r *http.Request, subscriber message.Subscriber)
- type CreateMessageRequest
- type CreateMessageResponse
- type Endpoints
- type GetMessageRequest
- type GetMessageResponse
- type ListMessagesRequest
- type ListMessagesResponse
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCreateMessageEndpoint ¶
MakeCreateMessageEndpoint returns an endpoint for the matching method of the underlying service.
func MakeGRPCServer ¶
func MakeGRPCServer(endpoints Endpoints, options ...kitgrpc.ServerOption) messagingv1.MessageListKitServer
MakeGRPCServer makes a set of endpoints available as a gRPC server.
func MakeGetMessageEndpoint ¶
MakeGetMessageEndpoint returns an endpoint for the matching method of the underlying service.
func MakeGraphQLHandler ¶
func MakeGraphQLHandler(endpoints Endpoints, errorHandler messaging.ErrorHandler) http.Handler
MakeGraphQLHandler mounts all of the service endpoints into a GraphQL handler.
func MakeListMessagesEndpoint ¶
MakeListMessagesEndpoint returns an endpoint for the matching method of the underlying service.
func RegisterHTTPHandlers ¶
func RegisterHTTPHandlers(endpoints Endpoints, router *mux.Router, options ...kithttp.ServerOption)
RegisterHTTPHandlers mounts all of the service endpoints into a router.
func RegisterWebSocketHandlers ¶
func RegisterWebSocketHandlers(router *mux.Router, subscriber message.Subscriber)
func ServeWS ¶
func ServeWS(w http.ResponseWriter, r *http.Request, subscriber message.Subscriber)
Types ¶
type CreateMessageRequest ¶
type CreateMessageRequest struct {
Text string
}
CreateMessageRequest is a request struct for CreateMessage endpoint.
type CreateMessageResponse ¶
CreateMessageResponse is a response struct for CreateMessage endpoint.
func (CreateMessageResponse) Failed ¶
func (r CreateMessageResponse) Failed() error
type Endpoints ¶
type Endpoints struct { CreateMessage endpoint.Endpoint GetMessage endpoint.Endpoint ListMessages endpoint.Endpoint }
Endpoints collects all of the endpoints that compose the underlying service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
func MakeEndpoints ¶
func MakeEndpoints(service messaging.Service, middleware ...endpoint.Middleware) Endpoints
MakeEndpoints returns a(n) Endpoints struct where each endpoint invokes the corresponding method on the provided service.
type GetMessageRequest ¶
type GetMessageRequest struct {
Id string
}
GetMessageRequest is a request struct for GetMessage endpoint.
type GetMessageResponse ¶
GetMessageResponse is a response struct for GetMessage endpoint.
func (GetMessageResponse) Failed ¶
func (r GetMessageResponse) Failed() error
type ListMessagesRequest ¶
type ListMessagesRequest struct{}
ListMessagesRequest is a request struct for ListMessages endpoint.
type ListMessagesResponse ¶
ListMessagesResponse is a response struct for ListMessages endpoint.
func (ListMessagesResponse) Failed ¶
func (r ListMessagesResponse) Failed() error
type Middleware ¶
Middleware describes a service middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger messaging.Logger) Middleware
LoggingMiddleware is a service level logging middleware for TodoList.