messagingdriver

package
v0.0.0-...-a671794 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCreateMessageEndpoint

func MakeCreateMessageEndpoint(service messaging.Service) endpoint.Endpoint

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

func MakeGetMessageEndpoint(service messaging.Service) endpoint.Endpoint

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

func MakeListMessagesEndpoint(service messaging.Service) endpoint.Endpoint

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

type CreateMessageResponse struct {
	ID  string
	Err error
}

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

type GetMessageResponse struct {
	Message messaging.Message
	Err     error
}

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

type ListMessagesResponse struct {
	Messages []messaging.Message
	Err      error
}

ListMessagesResponse is a response struct for ListMessages endpoint.

func (ListMessagesResponse) Failed

func (r ListMessagesResponse) Failed() error

type Middleware

type Middleware func(messaging.Service) messaging.Service

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger messaging.Logger) Middleware

LoggingMiddleware is a service level logging middleware for TodoList.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL