Documentation
¶
Overview ¶
Package grpcclientutil has helpers for configuring gRPC clients.
Index ¶
- func InsecureDialContext(connectCtx context.Context, address string, opts ...grpc.DialOption) *grpc.ClientConn
- func InvalidConn(msg string) *grpc.ClientConn
- func StreamInterceptorChain(first, second grpc.StreamClientInterceptor) grpc.StreamClientInterceptor
- func UnaryInterceptorChain(first, second grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsecureDialContext ¶
func InsecureDialContext(connectCtx context.Context, address string, opts ...grpc.DialOption) *grpc.ClientConn
InsecureDialContext connects to the given address. It sets up Prometheus and OpenTracing monitoring. It disables transport-level security.
The actual connection happens in the background; the given 'connectCtx' can be used to cancel this background activity. The caller must not pass grpc.WithBlock() as an option.
func InvalidConn ¶
func InvalidConn(msg string) *grpc.ClientConn
InvalidConn returns a non-nil gRPC connection in the TransientFailure state. Callers should Close() the returned connection when they're done with it.
InvalidConn can be useful to generate a dummy value in situations where having a nil grpc.ClientConn would be inconvenient.
func StreamInterceptorChain ¶
func StreamInterceptorChain(first, second grpc.StreamClientInterceptor) grpc.StreamClientInterceptor
StreamInterceptorChain lets you use multiple stream interceptors on a single client. gRPC only lets you have one top-level StreamClientInterceptor per client, so this chains them together.
func UnaryInterceptorChain ¶
func UnaryInterceptorChain(first, second grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
UnaryInterceptorChain lets you use multiple interceptors on a single client. gRPC only lets you have one top-level UnaryClientInterceptor per client, so this chains them together.
Types ¶
This section is empty.