Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Mode ¶ added in v0.2.0
type Mode int
Mode defines the algorithm of selecting a provider from cluster
type NewSelector ¶ added in v0.2.0
type Next ¶
type Next func(ID int64) (*registry.ServiceURL, error)
Next is a function that returns the next node based on the selector's strategy
type Option ¶
type Option func(*Options)
Option used to initialise the selector
func SelectMode ¶
SetStrategy sets the default strategy for the selector
type Selector ¶
type Selector interface { Options() Options // Select returns a function which should return the next node Select(conf registry.ServiceConfigIf) (Next, error) // Close renders the selector unusable Close() error // Name of the selector String() string }
Selector builds on the registry as a mechanism to pick nodes. This allows host pools and other things to be built using various algorithms.
Click to show internal directories.
Click to hide internal directories.