Documentation ¶ Index ¶ Variables func NewLBWithConfig(conf *Config) (stream.Handler, error) type Config type LB func NewLB(policy balance.Policy, handlers []stream.Handler) *LB func (l *LB) ServeStream(ctx context.Context, stm stream.Stream) type Weight 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 } Source Files ¶ View all Source files init.go lb.go Click to show internal directories. Click to hide internal directories.