Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHashRing ¶
type ConsistentHashRing struct {
// contains filtered or unexported fields
}
func New ¶
func New(replicas int, fn Hash) *ConsistentHashRing
func (*ConsistentHashRing) Add ¶
func (h *ConsistentHashRing) Add(nodes ...string)
Add adds some keys to the hash.
func (*ConsistentHashRing) Get ¶
func (h *ConsistentHashRing) Get(key string) string
Get gets the closest item in the hash to the provided key.
func (*ConsistentHashRing) IsEmpty ¶
func (h *ConsistentHashRing) IsEmpty() bool
IsEmpty returns true if there are no items available.
Click to show internal directories.
Click to hide internal directories.