Documentation ¶
Index ¶
- type HashFunc
- 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) GetNodeWithPos(pos int) (node string, ok bool)
- func (h *HashRing) GetNodes(stringKey string, size int) (nodes []string, ok bool)
- func (h *HashRing) RemoveNode(node string) *HashRing
- func (h *HashRing) Size() int
- func (h *HashRing) UpdateWeightedNode(node string, weight int) *HashRing
- func (h *HashRing) UpdateWithWeights(weights map[string]int)
- type HashSum
- type Int64PairHashKey
- type Uint32HashKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashKey ¶
func NewInt64PairHashKey ¶
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 NewWithHash ¶
func NewWithHashAndWeights ¶
func NewWithWeights ¶
func (*HashRing) AddWeightedNode ¶
func (*HashRing) RemoveNode ¶
func (*HashRing) UpdateWeightedNode ¶
func (*HashRing) UpdateWithWeights ¶
type HashSum ¶
HashSum allows to use a builder pattern to create different HashFunc objects. See examples for details.
func (HashSum) FirstBytes ¶
type Int64PairHashKey ¶
func (*Int64PairHashKey) Less ¶
func (k *Int64PairHashKey) Less(other HashKey) bool
type Uint32HashKey ¶
type Uint32HashKey uint32
func (Uint32HashKey) Less ¶
func (k Uint32HashKey) Less(other HashKey) bool
Click to show internal directories.
Click to hide internal directories.