package addtransport

import "github.com/go-kit/kit/examples/addsvc/pkg/addtransport"

Index

Functions

func MakeThriftConcatEndpoint

func MakeThriftConcatEndpoint(client *addthrift.AddServiceClient) endpoint.Endpoint

MakeThriftConcatEndpoint returns an endpoint that invokes the passed Thrift client. Useful only in clients, and only until a proper transport/thrift.Client exists.

func MakeThriftSumEndpoint

func MakeThriftSumEndpoint(client *addthrift.AddServiceClient) endpoint.Endpoint

MakeThriftSumEndpoint returns an endpoint that invokes the passed Thrift client. Useful only in clients, and only until a proper transport/thrift.Client exists.

func NewGRPCClient

func NewGRPCClient(conn *grpc.ClientConn, tracer stdopentracing.Tracer, logger log.Logger) addservice.Service

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 NewGRPCServer

func NewGRPCServer(endpoints addendpoint.Set, tracer stdopentracing.Tracer, logger log.Logger) pb.AddServer

NewGRPCServer makes a set of endpoints available as a gRPC AddServer.

func NewHTTPClient

func NewHTTPClient(instance string, tracer stdopentracing.Tracer, logger log.Logger) (addservice.Service, 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.

func NewHTTPHandler

func NewHTTPHandler(endpoints addendpoint.Set, tracer stdopentracing.Tracer, logger log.Logger) http.Handler

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

func NewThriftClient

func NewThriftClient(client *addthrift.AddServiceClient) addservice.Service

NewThriftClient returns an AddService backed by a Thrift server described by the provided client. The caller is responsible for constructing the client, and eventually closing the underlying transport. We bake-in certain middlewares, implementing the client library pattern.

func NewThriftServer

func NewThriftServer(endpoints addendpoint.Set) addthrift.AddService

NewThriftServer makes a set of endpoints available as a Thrift service.

Source Files

grpc.go http.go thrift.go

Version
v0.6.0
Published
Oct 3, 2017
Platform
js/wasm
Imports
25 packages
Last checked
4 days ago

Tools for package owners.