Documentation ¶
Index ¶
- type HashKey
- type HashKeyOrder
- type HashRing
- func (h *HashRing) AddNode(node string) *HashRing
- func (h *HashRing) AddWeightedNode(node string, weight int) *HashRing
- func (h *HashRing) GenKey(key string) HashKey
- func (h *HashRing) GetNode(stringKey string) (node string, ok bool)
- func (h *HashRing) GetNodePos(stringKey string) (pos int, ok bool)
- func (h *HashRing) GetNodes(stringKey string, size int) (nodes []string, ok bool)
- func (h *HashRing) RemoveNode(node string) *HashRing
- func (h *HashRing) UpdateWeightedNode(node string, weight int) *HashRing
- func (h *HashRing) UpdateWithWeights(weights map[string]int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashKeyOrder ¶
type HashKeyOrder []HashKey
func (HashKeyOrder) Len ¶
func (h HashKeyOrder) Len() int
func (HashKeyOrder) Less ¶
func (h HashKeyOrder) Less(i, j int) bool
func (HashKeyOrder) Swap ¶
func (h HashKeyOrder) Swap(i, j int)
type HashRing ¶
type HashRing struct {
// contains filtered or unexported fields
}
func NewWithWeights ¶
func (*HashRing) AddWeightedNode ¶
func (*HashRing) RemoveNode ¶
func (*HashRing) UpdateWeightedNode ¶
func (*HashRing) UpdateWithWeights ¶
Click to show internal directories.
Click to hide internal directories.