Versions in this module Expand all Collapse all v1 v1.16.1 Nov 13, 2019 Changes in this version + var DefaultSelector = NewSelector() + var ErrNoneAvailable = errors.New("none available") + var ErrNotFound = errors.New("not found") + type Filter func([]*registry.Service) []*registry.Service + func FilterEndpoint(name string) Filter + func FilterLabel(key, val string) Filter + func FilterVersion(version string) Filter + type Next func() (*registry.Node, error) + func Random(services []*registry.Service) Next + func RoundRobin(services []*registry.Service) Next + type Option func(*Options) + func Registry(r registry.Registry) Option + func SetStrategy(fn Strategy) Option + type Options struct + Context context.Context + Registry registry.Registry + Strategy Strategy + type SelectOption func(*SelectOptions) + func WithFilter(fn ...Filter) SelectOption + func WithStrategy(fn Strategy) SelectOption + type SelectOptions struct + Context context.Context + Filters []Filter + Strategy Strategy + type Selector interface + Close func() error + Init func(opts ...Option) error + Mark func(service string, node *registry.Node, err error) + Options func() Options + Reset func(service string) + Select func(service string, opts ...SelectOption) (Next, error) + String func() string + func NewSelector(opts ...Option) Selector + type Strategy func([]*registry.Service) Next