Documentation ¶
Index ¶
- type HashRing
- func (r *HashRing) AddNode(id string, node *Node)
- func (r *HashRing) IsOnline(ID string) bool
- func (r *HashRing) Node(ID string) *Node
- func (r *HashRing) NodeCount() uint32
- func (r *HashRing) NodeOkCount() uint32
- func (r *HashRing) RandomNode(seed string) (string, *Node)
- func (r *HashRing) RandomNodeExcludedIDs(excludedIDs []string, seed string) (string, *Node)
- func (r *HashRing) RandomNodes(num int, seed string) []*Node
- func (r *HashRing) RemoveNode(ID string)
- func (r *HashRing) SetOffline(ID string)
- func (r *HashRing) SetOnline(ID string)
- func (r *HashRing) String() string
- func (r *HashRing) UpdateNodeDiskUsage(ID string, diskSize, freeDisk uint64)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashRing ¶
func (*HashRing) NodeOkCount ¶
func (*HashRing) RandomNode ¶
RandomNode uses the given seed to select a random online node If the seed is empty, it will use a cryptographically secure random seed
func (*HashRing) RandomNodeExcludedIDs ¶
RandomNodeExcludedIDs uses the given seed to select a random online node, while excluding specified nodes If the seed is empty, it will use a cryptographically secure random seed
func (*HashRing) RandomNodes ¶
RandomNodes return random nodes from the hashring If the seed is empty, it will use a cryptographically secure random seed
func (*HashRing) RemoveNode ¶
func (*HashRing) SetOffline ¶
func (*HashRing) UpdateNodeDiskUsage ¶
Click to show internal directories.
Click to hide internal directories.