Documentation
¶
Index ¶
- type ConsistentHash
- type ConsistentHashOption
- type Hash
- type HashFunction
- type SortedMap
- func (s *SortedMap[K, T]) Add(key K, item T)
- func (s *SortedMap[K, T]) Contains(key K) bool
- func (s *SortedMap[K, T]) Empty() bool
- func (s *SortedMap[K, T]) First() T
- func (s *SortedMap[K, T]) Get(key K) T
- func (s *SortedMap[K, T]) Keys() []K
- func (s *SortedMap[K, T]) Remove(key K)
- func (s *SortedMap[K, T]) Tail(key K) []K
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHash ¶
type ConsistentHash[T Hash] struct { // contains filtered or unexported fields }
func NewConsistentHash ¶
func NewConsistentHash[T Hash](replicate uint, opts ...ConsistentHashOption[T]) *ConsistentHash[T]
func (*ConsistentHash[T]) Add ¶
func (s *ConsistentHash[T]) Add(node T)
func (*ConsistentHash[T]) Get ¶
func (s *ConsistentHash[T]) Get(key uint) T
func (*ConsistentHash[T]) Remove ¶
func (s *ConsistentHash[T]) Remove(node T)
type ConsistentHashOption ¶
type ConsistentHashOption[T Hash] func(*ConsistentHash[T])
func WithHash ¶
func WithHash[T Hash](hash HashFunction) ConsistentHashOption[T]
type HashFunction ¶
type SortedMap ¶
func NewSortedMap ¶
Click to show internal directories.
Click to hide internal directories.