Documentation ¶
Overview ¶
Package discover implements a gRPC discovery middleware.
Index ¶
- func DialContext(ctx context.Context, target string, creds credentials.TransportCredentials, ...) (*grpc.ClientConn, error)
- func DialOptions(ctx context.Context, target string, creds credentials.TransportCredentials) ([]grpc.DialOption, error)
- func WithInsecure() []grpc.DialOption
- func WithTLSFallback(parent context.Context, tls bool) context.Context
- func WithTransportCredentials(creds credentials.TransportCredentials) []grpc.DialOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialContext ¶
func DialContext(ctx context.Context, target string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error)
DialContext creates a client connection to the given target. It uses DialOptions to discover gRPC dial options for the target.
func DialOptions ¶
func DialOptions(ctx context.Context, target string, creds credentials.TransportCredentials) ([]grpc.DialOption, error)
DialOptions discovers gRPC dial options based on the given target. This includes whether or not transport level security is enabled and service port discovery.
func WithInsecure ¶
func WithInsecure() []grpc.DialOption
WithInsecure returns gRPC dial options which disable transport security and discover the default insecure listen port if not specified in the dial target.
func WithTLSFallback ¶
WithTLSFallback returns a derived context which is configured to fall back to the given TLS setting if discovery fails.
func WithTransportCredentials ¶
func WithTransportCredentials(creds credentials.TransportCredentials) []grpc.DialOption
WithTransportCredentials returns gRPC dial options which configures connection level security credentials (e.g., TLS/SSL) and discover the TLS/SSL listen port if not specified in the dial target.
Types ¶
This section is empty.