lb

package
v0.6.0 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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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