Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHash ¶
type ConsistentHash struct {
// contains filtered or unexported fields
}
ConsistentHash contains all hashed keys
func NewConsistentHash ¶
func NewConsistentHash(replicas int, fn Hash) *ConsistentHash
NewConsistentHash creates a Map instance hash func defaults to crc32
func (*ConsistentHash) AddNode ¶
func (ch *ConsistentHash) AddNode(keys ...string)
AddNode adds a node into hash ring
func (*ConsistentHash) DelNode ¶
func (ch *ConsistentHash) DelNode(keys ...string)
func (*ConsistentHash) GetNode ¶
func (ch *ConsistentHash) GetNode(key string) string
GetNode gets a node according to the key
Click to show internal directories.
Click to hide internal directories.