Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProxyStream ¶
func ProxyStream(director StreamDirector, logger grpclog.Logger, frontTrans transport.ServerTransport, frontStream *transport.Stream)
ProxyStream performs a forward of a gRPC frontend stream to a backend.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(director StreamDirector, opt ...ProxyOption) *Proxy
NewServer creates a gRPC proxy which will use the `StreamDirector` for making routing decisions.
type ProxyOption ¶
type ProxyOption func(*options)
A ProxyOption sets options.
func Creds ¶
func Creds(c credentials.TransportCredentials) ProxyOption
Creds returns a ProxyOption that sets credentials for server connections.
func MaxConcurrentStreams ¶
func MaxConcurrentStreams(n uint32) ProxyOption
MaxConcurrentStreams returns a ProxyOption that will apply a limit on the number of concurrent streams to each ServerTransport.
func UsingLogger ¶
func UsingLogger(logger grpclog.Logger) ProxyOption
UsingLogger returns a ProxyOption that makes use of a logger other than the default `grpclogger`.
type StreamDirector ¶
type StreamDirector func(ctx context.Context) (*grpc.ClientConn, error)
StreamDirector returns a gRPC ClientConn for a stream of a given context. The service name, method name, and other `MD` metadata (e.g. authority) can be extracted from Context.