Documentation ¶
Index ¶
- type Entry
- type HashRing
- func (r *HashRing[E]) Add(entry E) (prevActive E, cLow uint64, cHigh uint64, active func(), cancel func(), ok bool)
- func (r *HashRing[E]) AddDeclared(entry E, low uint64, high uint64) (ok bool)
- func (r *HashRing[E]) Get(key []byte) (entry E, has bool)
- func (r *HashRing[E]) Size() (n int)
- func (r *HashRing[E]) State(key string) (active bool, low uint64, high uint64, has bool)
- func (r *HashRing[E]) States(fn func(key string, active bool, low uint64, high uint64) bool)
- func (r *HashRing[E]) String() (s string)
- type HashRingEntries
- func (entries HashRingEntries[E]) BiggestRangeAndActiveOne() (entry *HashRingEntry[E])
- func (entries HashRingEntries[E]) Get(n uint64) (entry *HashRingEntry[E], has bool)
- func (entries HashRingEntries[E]) Len() int
- func (entries HashRingEntries[E]) Less(i, j int) bool
- func (entries HashRingEntries[E]) Swap(i, j int)
- type HashRingEntry
- type ImmutableRing
- type RangeSizeSortedHashRingEntries
- type Ring
- func (r *Ring[E]) Get(key string) (value E, has bool)
- func (r *Ring[E]) Head() (value E, has bool)
- func (r *Ring[E]) Key() (key string)
- func (r *Ring[E]) Len() (size int)
- func (r *Ring[E]) Next() (value E)
- func (r *Ring[E]) Pop() (e E, ok bool)
- func (r *Ring[E]) Push(v E) (ok bool)
- func (r *Ring[E]) Remove(key string)
- func (r *Ring[E]) SeekTo(key string) (has bool)
- func (r *Ring[E]) String() (value string)
- type Sequence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashRing ¶ added in v1.1.0
type HashRing[E Entry] struct { // contains filtered or unexported fields }
func (*HashRing[E]) AddDeclared ¶ added in v1.1.1
type HashRingEntries ¶ added in v1.1.0
type HashRingEntries[E Entry] []*HashRingEntry[E]
func (HashRingEntries[E]) BiggestRangeAndActiveOne ¶ added in v1.1.0
func (entries HashRingEntries[E]) BiggestRangeAndActiveOne() (entry *HashRingEntry[E])
func (HashRingEntries[E]) Get ¶ added in v1.1.0
func (entries HashRingEntries[E]) Get(n uint64) (entry *HashRingEntry[E], has bool)
func (HashRingEntries[E]) Len ¶ added in v1.1.0
func (entries HashRingEntries[E]) Len() int
func (HashRingEntries[E]) Less ¶ added in v1.1.0
func (entries HashRingEntries[E]) Less(i, j int) bool
func (HashRingEntries[E]) Swap ¶ added in v1.1.0
func (entries HashRingEntries[E]) Swap(i, j int)
type HashRingEntry ¶ added in v1.1.0
func (*HashRingEntry[E]) Less ¶ added in v1.1.0
func (entry *HashRingEntry[E]) Less(o *HashRingEntry[E]) bool
func (*HashRingEntry[E]) RangeSize ¶ added in v1.1.0
func (entry *HashRingEntry[E]) RangeSize() uint64
func (*HashRingEntry[E]) String ¶ added in v1.1.0
func (entry *HashRingEntry[E]) String() (s string)
type ImmutableRing ¶
type ImmutableRing[E Entry] struct { // contains filtered or unexported fields }
func NewImmutable ¶
func NewImmutable[E Entry](key string, values []E) (r *ImmutableRing[E])
func (*ImmutableRing[E]) Get ¶
func (r *ImmutableRing[E]) Get(key string) (value E, has bool)
func (*ImmutableRing[E]) Head ¶
func (r *ImmutableRing[E]) Head() (value E, has bool)
func (*ImmutableRing[E]) Key ¶
func (r *ImmutableRing[E]) Key() (key string)
func (*ImmutableRing[E]) Next ¶
func (r *ImmutableRing[E]) Next() (value E)
func (*ImmutableRing[E]) String ¶
func (r *ImmutableRing[E]) String() (value string)
type RangeSizeSortedHashRingEntries ¶ added in v1.1.0
type RangeSizeSortedHashRingEntries[E Entry] []*HashRingEntry[E]
func (RangeSizeSortedHashRingEntries[E]) Len ¶ added in v1.1.0
func (entries RangeSizeSortedHashRingEntries[E]) Len() int
func (RangeSizeSortedHashRingEntries[E]) Less ¶ added in v1.1.0
func (entries RangeSizeSortedHashRingEntries[E]) Less(i, j int) bool
func (RangeSizeSortedHashRingEntries[E]) Swap ¶ added in v1.1.0
func (entries RangeSizeSortedHashRingEntries[E]) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.