Documentation
¶
Overview ¶
Package rendezvous implements rendezvous hashing (a.k.a. highest random weight hashing). See http://en.wikipedia.org/wiki/Rendezvous_hashing for more information.
Index ¶
- type Node
- type Ring
- func (r *Ring) Add(name string)
- func (r *Ring) AddWithWeight(name string, weight float64)
- func (r *Ring) Contains(name string) bool
- func (r *Ring) Len() int
- func (r *Ring) List() []string
- func (r *Ring) Lookup(key string) string
- func (r *Ring) LookupAll(key string) []string
- func (r *Ring) LookupTopN(key string, n int) []string
- func (r *Ring) Remove(name string)
- func (r *Ring) Weight(name string) float64
- type ScoredNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ring ¶ added in v0.1.4
type Ring struct {
// contains filtered or unexported fields
}
A Ring is a collection of nodes making up a rendezvous group. Nodes have a label and, optionally, a weight. If unspecified, a default weighting is used.
func NewWithHash ¶ added in v0.1.4
func (*Ring) AddWithWeight ¶ added in v0.1.4
type ScoredNode ¶ added in v0.1.4
type ScoredNode struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.