balancer

package
v3.42.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 24 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 Balancer

type Balancer struct {
	// contains filtered or unexported fields
}

func New added in v3.26.0

func New(
	ctx context.Context,
	driverConfig config.Config,
	pool *conn.Pool,
	opts ...discoveryConfig.Option,
) (b *Balancer, err error)

func (*Balancer) Close added in v3.34.0

func (b *Balancer) Close(ctx context.Context) (err error)

func (*Balancer) Invoke added in v3.34.0

func (b *Balancer) Invoke(
	ctx context.Context,
	method string,
	args interface{},
	reply interface{},
	opts ...grpc.CallOption,
) error

func (*Balancer) NewStream added in v3.34.0

func (b *Balancer) NewStream(
	ctx context.Context,
	desc *grpc.StreamDesc,
	method string,
	opts ...grpc.CallOption,
) (_ grpc.ClientStream, err error)

func (*Balancer) OnUpdate added in v3.37.7

func (b *Balancer) OnUpdate(onApplyDiscoveredEndpoints func(ctx context.Context, endpoints []endpoint.Info))

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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