Documentation ¶ Index ¶ Constants func New(opts ...Option) selector.Selector type Balancer func (s *Balancer) Pick(ctx context.Context, nodes []selector.WeightedNode) (selector.WeightedNode, selector.DoneFunc, error) type Option func WithFilter(filters ...selector.Filter) Option Constants ¶ View Source const ( // Name is balancer name Name = "p2c" ) Variables ¶ This section is empty. Functions ¶ func New ¶ func New(opts ...Option) selector.Selector New creates a p2c selector. Types ¶ type Balancer ¶ type Balancer struct { // contains filtered or unexported fields } Balancer is p2c selector. func (*Balancer) Pick ¶ func (s *Balancer) Pick(ctx context.Context, nodes []selector.WeightedNode) (selector.WeightedNode, selector.DoneFunc, error) Pick pick a 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 p2c.go Click to show internal directories. Click to hide internal directories.