Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager interface {
// adds a node to the node ring.
Add(node *Node)
// get the node responsible for the data key.
NodeFor(keys ...string) (*Node, bool)
// removes all nodes from the node ring.
Remove()
// removes a node from the node ring.
RemoveByID(id string)
// print all nodes
PrintNodes()
// is the node ring empty
IsEmpty() bool
}
Manager node manager functions defines.
func NewConsistent ¶
NewConsistent get consistent node manager
func NewRoundRobin ¶
NewRoundRobin get roundrobin node manager
type Node ¶
type Node struct {
// for recognize node with input id
ID string `yaml:"id" json:"id"`
// node's probability weight, roundrobin does not support
Weight uint32 `yaml:"weight" json:"weight"`
// node's value
Value string `yaml:"value" json:"value"`
// kvs for meta data
Metadata config.Options `yaml:"options" json:"options"`
// contains filtered or unexported fields
}
Node params for a node
Click to show internal directories.
Click to hide internal directories.