Documentation ¶
Index ¶
Constants ¶
View Source
const (
HashMethodFnv1a = "fnv1a_64"
)
constants defines
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HashRing ¶
type HashRing struct {
// contains filtered or unexported fields
}
HashRing ketama hash ring.
func Ketama ¶
func Ketama() (h *HashRing)
Ketama new a hash ring with ketama consistency. Default hash: fnv1a64
func (*HashRing) AddNode ¶
AddNode a new node to the hash ring. n: name of the server s: multiplier for default number of ticks (useful when one cache node has more resources, like RAM, than another)
func (*HashRing) DelNode ¶
DelNode delete a node from the hash ring. n: name of the server s: multiplier for default number of ticks (useful when one cache node has more resources, like RAM, than another)
Click to show internal directories.
Click to hide internal directories.