grpcclient

package
v0.43.3-0...-9926edd Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConnProvider

type ClientConnProvider interface {
	// NewClientConn gets a client conn for the given address. It may reuse a pooled client conn.
	//
	// The given Context is only used for dialing if the connection is not already cached.
	NewClientConn(ctx context.Context, address string) (grpc.ClientConnInterface, error)
}

ClientConnProvider provides client connections.

func NewClientConnProvider

func NewClientConnProvider(
	ctx context.Context,
	logger *zap.Logger,
	options ...ClientConnProviderOption,
) (ClientConnProvider, error)

NewClientConnProvider returns a new ClientConnProvider. It handles the closing of the clientConns created through it.

type ClientConnProviderOption

type ClientConnProviderOption func(*clientConnProvider)

ClientConnProviderOption is an option for a new ClientConn.

func ClientConnProviderWithObservability

func ClientConnProviderWithObservability() ClientConnProviderOption

ClientConnProviderWithObservability returns a new ClientConnProviderOption to use OpenCensus tracing and metrics.

The default is to use no observability.

func ClientConnProviderWithTLSConfig

func ClientConnProviderWithTLSConfig(tlsConfig *tls.Config) ClientConnProviderOption

ClientConnProviderWithTLSConfig returns a new ClientConnProviderOption to use the tls.Config.

The default is to use no TLS.

Jump to

Keyboard shortcuts

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