Documentation
¶
Overview ¶
Copyright (c) 2015 Peter Bourgon Copyright (c) 2018 Gian Giovani
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NopRequestDecoder ¶
NopRequestDecoder is a DecodeRequestFunc that can be used for requests that do not need to be decoded, and simply returns nil, nil.
Types ¶
type DecodeRequestFunc ¶
DecodeRequestFunc extracts a user-domain request object from an gRPC request object. It's designed to be used in gRPC servers, for server-side endpoints.
type EncodeResponseFunc ¶
EncodeResponseFunc encodes the passed response object to the gRPC response writer. It's designed to be used in gRPC servers, for server-side endpoints.
type Handler ¶
type Handler interface {
ServeGRPC(context.Context, interface{}) (context.Context, interface{}, error)
}
Handler which should be called from the gRPC binding of the service implementation. The incoming request parameter, and returned response parameter, are both gRPC types, not user-domain.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an endpoint and implements http.Handler.
func New ¶
func New(endpoint endpoint.Endpoint, dec DecodeRequestFunc, enc EncodeResponseFunc, options ...serverOption) *Server
New server instance which wrap and endpoint