lb

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 5 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) (http.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 []http.Handler) *LB

func (*LB) ServeHTTP added in v0.5.0

func (l *LB) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Weight

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

Jump to

Keyboard shortcuts

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