Documentation ¶ Index ¶ Variables func NewLBWithConfig(conf *Config) (http.Handler, error) type Config type LB func NewLB(policy balance.Policy, handlers []http.Handler) *LB func (l *LB) ServeHTTP(rw http.ResponseWriter, r *http.Request) type Weight 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 } Source Files ¶ View all Source files init.go lb.go Click to show internal directories. Click to hide internal directories.