Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Next ¶
Next is a function that returns the next node based on the selector's strategy.
func RoundRobin ¶
RoundRobin is a roundrobin strategy algorithm for node selection
type Option ¶
type Option func(*Options)
func WithCacheSeconds ¶
WithCacheSeconds sets the seconds of cache ttl
func WithRegistry ¶
WithRegistry sets the registry used by the selector.
func WithStrategy ¶
WithStrategy sets the default strategy for the selector.
type Selector ¶
type Selector interface { // Select returns a function which should return the next node Select(service string, filters ...Filter) (Next, error) // Mark sets the success/error against a node Mark(service string, node *micro.Node, err error) // Reset returns state back to zero for a service Reset(service string) // Close renders the selector unusable Close() error Name() string }
func NewSelector ¶
Click to show internal directories.
Click to hide internal directories.