balancer

package
v3.34.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 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

func WithNodeID added in v3.34.0

func WithNodeID(ctx context.Context, id uint32) 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,
	c 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) Discovery added in v3.34.0

func (b *Balancer) Discovery() discovery.Client

func (*Balancer) Endpoint added in v3.34.0

func (b *Balancer) Endpoint() string

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) Name added in v3.34.0

func (b *Balancer) Name() string

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) Secure added in v3.34.0

func (b *Balancer) Secure() bool

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