lb

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotHandler = fmt.Errorf("error not handler")
)

Functions

func NewLBWithConfig

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

Types

type Config

type Config struct {
	Policy   balance.Policy
	Handlers []*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, handlers []stream.Handler) *LB

func (*LB) ServeStream added in v0.5.0

func (l *LB) ServeStream(ctx context.Context, stm stream.Stream)

type Weight

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

Jump to

Keyboard shortcuts

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