balancer

package
v3.32.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEndpoints = xerrors.Wrap(fmt.Errorf("no endpoints"))

Functions

func WithEndpoint added in v3.26.0

func WithEndpoint(ctx context.Context, endpoint Endpoint) context.Context

Types

type Connection added in v3.26.0

type Connection interface {
	Info
	Router
	Discoverer
}

func New added in v3.26.0

func New(
	ctx context.Context,
	c config.Config,
	pool *conn.Pool,
	opts ...discoveryConfig.Option,
) (_ Connection, err error)

type Discoverer added in v3.26.0

type Discoverer interface {
	Discovery() discovery.Client
}

type Endpoint added in v3.26.0

type Endpoint interface {
	NodeID() uint32
}

func ContextEndpoint added in v3.26.0

func ContextEndpoint(ctx context.Context) (e Endpoint, ok bool)

type Info added in v3.26.0

type Info interface {
	// Endpoint returns initial endpoint
	Endpoint() string

	// Name returns balancer name
	Name() string

	// Secure returns true if balancer connection is secure
	Secure() bool
}

type Router added in v3.26.0

type Router interface {
	// ClientConnInterface interface allows Router use as grpc.ClientConnInterface
	// with lazy getting raw grpc-connection in Invoke() or NewStream() stages.
	// Lazy getting grpc-connection must use for embedded into driver client-side
	// balancing may be put into code-generated client constructor as is.
	grpc.ClientConnInterface
	closer.Closer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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