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 random balancer name Name = "random" ) Variables ¶ This section is empty. Functions ¶ func New ¶ func New(opts ...Option) selector.Selector New random a selector. Types ¶ type Balancer ¶ type Balancer struct{} 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 random.go Click to show internal directories. Click to hide internal directories.