mathtransport

package
v0.0.0-...-14493fd Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

func NewHTTPClient(instance string, logger log.Logger) (mathservice2.Service, error)

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

func NewHTTPHandler(endpoints mathendpoint2.Set, logger log.Logger) http.Handler

NewHTTPHandler returns an HTTP handler that makes a set of endpoints available on predefined paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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