Versions in this module Expand all Collapse all v2 v2.1.6 Mar 10, 2022 v2.1.5 Mar 10, 2022 Changes in this version + var ErrNoAvailable = errors.ServiceUnavailable("no_available_node", "") + type Balancer interface + Pick func(ctx context.Context, nodes []WeightedNode) (selected WeightedNode, done DoneFunc, err error) + type BalancerBuilder interface + Build func() Balancer + type Builder interface + Build func() Selector + type Default struct + Balancer Balancer + Filters []Filter + NodeBuilder WeightedNodeBuilder + func (d *Default) Apply(nodes []Node) + func (d *Default) Select(ctx context.Context, opts ...SelectOption) (selected Node, done DoneFunc, err error) + type DefaultBuilder struct + Balancer BalancerBuilder + Filters []Filter + Node WeightedNodeBuilder + func (db *DefaultBuilder) Build() Selector + type DefaultNode struct + func (n *DefaultNode) Address() string + func (n *DefaultNode) InitialWeight() *int64 + func (n *DefaultNode) Metadata() map[string]string + func (n *DefaultNode) ServiceName() string + func (n *DefaultNode) Version() string + type DoneFunc func(ctx context.Context, di DoneInfo) + type DoneInfo struct + BytesReceived bool + BytesSent bool + Err error + ReplyMeta ReplyMeta + type Filter func(context.Context, []Node) []Node + type Node interface + Address func() string + InitialWeight func() *int64 + Metadata func() map[string]string + ServiceName func() string + Version func() string + func NewNode(addr string, ins *registry.ServiceInstance) Node + type Rebalancer interface + Apply func(nodes []Node) + type ReplyMeta interface + Get func(key string) string + type SelectOption func(*SelectOptions) + func WithFilter(fn ...Filter) SelectOption + type SelectOptions struct + Filters []Filter + type Selector interface + Select func(ctx context.Context, opts ...SelectOption) (selected Node, done DoneFunc, err error) + type WeightedNode interface + Pick func() DoneFunc + PickElapsed func() time.Duration + Raw func() Node + Weight func() float64 + type WeightedNodeBuilder interface + Build func(Node) WeightedNode