discover

package
v0.0.0-...-5352646 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package discover implements a gRPC discovery middleware.

Index

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

func WithTLSFallback(parent context.Context, tls bool) context.Context

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.

Jump to

Keyboard shortcuts

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