lb

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDialer = fmt.Errorf("error not dialer")
)

Functions

func NewLBWithConfig

func NewLBWithConfig(conf *Config) (stream.Dialer, error)

Types

type Config

type Config struct {
	Policy  balance.Policy
	Dialers []*Weight
}

type LB added in v0.5.0

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

func NewLB added in v0.5.0

func NewLB(policy balance.Policy, dialers []stream.Dialer) *LB

func (*LB) DialStream added in v0.5.0

func (l *LB) DialStream(ctx context.Context) (stm stream.Stream, err error)

func (*LB) Policy added in v0.5.2

func (l *LB) Policy() balance.Policy

func (*LB) String added in v0.5.2

func (l *LB) String() string

func (*LB) Targets added in v0.5.0

func (l *LB) Targets() []stream.Dialer

type Weight

type Weight struct {
	Weight uint `json:",omitempty"`
	Dialer stream.Dialer
}

Jump to

Keyboard shortcuts

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