Documentation ¶
Index ¶
- func HTTPStatusFromCode(code codes.Code) int
- func JSONErrorDecoder(r *http.Response) error
- func MakeGRPCServer(endpoints endpoints.Endpoints, otTracer stdopentracing.Tracer, ...) (req pb.FoosvcServer)
- func NewGRPCClient(conn *grpc.ClientConn, otTracer stdopentracing.Tracer, ...) service.FoosvcService
- func NewHTTPClient(instance string, otTracer stdopentracing.Tracer, ...) (service.FoosvcService, error)
- func NewHTTPHandler(endpoints endpoints.Endpoints, otTracer stdopentracing.Tracer, ...) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPStatusFromCode ¶
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
func JSONErrorDecoder ¶
func MakeGRPCServer ¶
func MakeGRPCServer(endpoints endpoints.Endpoints, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer, logger log.Logger) (req pb.FoosvcServer)
MakeGRPCServer makes a set of endpoints available as a gRPC server.
func NewGRPCClient ¶
func NewGRPCClient(conn *grpc.ClientConn, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer, logger log.Logger) service.FoosvcService
NewGRPCClient returns an AddService backed by a gRPC server at the other end of the conn. The caller is responsible for constructing the conn, and eventually closing the underlying transport. We bake-in certain middlewares, implementing the client library pattern.
func NewHTTPClient ¶
func NewHTTPClient(instance string, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer, logger log.Logger) (service.FoosvcService, error)
NewHTTPClient returns an AddService backed by an HTTP server living at the remote instance. We expect instance to come from a service discovery system, so likely of the form "host:port". We bake-in certain middlewares, implementing the client library pattern.
Types ¶
This section is empty.