Documentation ¶
Index ¶
- func NewGRPCClient(conn *grpc.ClientConn, logger log.Logger) mathservice2.Service
- func NewGRPCServer(endpoints mathendpoint2.Set, logger log.Logger) pb.MathServer
- func NewHTTPClient(instance string, logger log.Logger) (mathservice2.Service, error)
- func NewHTTPHandler(endpoints mathendpoint2.Set, logger log.Logger) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGRPCClient ¶
func NewGRPCClient(conn *grpc.ClientConn, logger log.Logger) mathservice2.Service
NewGRPCClient returns an MathService 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 NewGRPCServer ¶
func NewGRPCServer(endpoints mathendpoint2.Set, logger log.Logger) pb.MathServer
NewGRPCServer makes a set of endpoints available as a gRPC MathServer.
func NewHTTPClient ¶
NewHTTPClient returns an MathService 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.
func NewHTTPHandler ¶
NewHTTPHandler returns an HTTP handler that makes a set of endpoints available on predefined paths.
Types ¶
This section is empty.