Documentation ¶
Overview ¶
Package picker gets list of healthy nodes and pick one of them randomly based on weight
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomWeighted ¶
type RandomWeighted struct {
// contains filtered or unexported fields
}
RandomWeighted implements picker with the random, weighted selection
func NewRandomWeighted ¶
func NewRandomWeighted(nodes config.NodesMap, refresh, timeout time.Duration, failBackURL string) *RandomWeighted
NewRandomWeighted makes new picker. Activate alive update thread
func (*RandomWeighted) Nodes ¶
func (w *RandomWeighted) Nodes() map[string][]Node
Nodes return list of all current nodes
func (*RandomWeighted) Pick ¶
func (w *RandomWeighted) Pick(svc, resource string) (resURL string, node Node, err error)
Pick random node with weights
func (*RandomWeighted) Status ¶ added in v1.2.0
func (w *RandomWeighted) Status() (ok bool, failed []string)
Status return status of all nodes, true if all nodes are alive, false if at least one is dead and return list of dead nodes
Click to show internal directories.
Click to hide internal directories.