Documentation ¶ Index ¶ Constants func New(opts ...Option) selector.Selector type Balancer func (p *Balancer) Pick(_ context.Context, nodes []selector.WeightedNode) (selector.WeightedNode, selector.DoneFunc, error) type Option func WithFilter(filters ...selector.Filter) Option Constants ¶ View Source const ( // Name is wrr balancer name Name = "wrr" ) Variables ¶ This section is empty. Functions ¶ func New ¶ func New(opts ...Option) selector.Selector New random a selector. Types ¶ type Balancer ¶ type Balancer struct { // contains filtered or unexported fields } Balancer is a random balancer. func (*Balancer) Pick ¶ func (p *Balancer) Pick(_ context.Context, nodes []selector.WeightedNode) (selector.WeightedNode, selector.DoneFunc, error) Pick pick a weighted node. type Option ¶ type Option func(o *options) Option is random builder option. func WithFilter ¶ func WithFilter(filters ...selector.Filter) Option WithFilter with select filters Source Files ¶ View all Source files wrr.go Click to show internal directories. Click to hide internal directories.