Documentation
¶
Index ¶
- type IndexedList
- func (l *IndexedList[T]) Get(index string) *T
- func (l *IndexedList[T]) Gets(indexes []string) map[string]T
- func (l *IndexedList[T]) HalveReadCounts()
- func (l *IndexedList[T]) Len() int
- func (l *IndexedList[T]) OrderedReadWriteCounts() []uint32
- func (l *IndexedList[T]) Pop(amount int) []T
- func (l *IndexedList[T]) PopWhere(predicate func(T) bool, amount int) []T
- func (l *IndexedList[T]) ReadWriteCounts(indexes []string) map[string]uint32
- func (l *IndexedList[T]) Remove(indexes []string)
- func (l *IndexedList[T]) Set(values []T)
- func (l *IndexedList[T]) SortByReadCount()
- type LRMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexedList ¶
func NewIndexedList ¶
func NewIndexedList[T element.Indexable]() IndexedList[T]
func (*IndexedList[T]) Get ¶
func (l *IndexedList[T]) Get(index string) *T
func (*IndexedList[T]) Gets ¶
func (l *IndexedList[T]) Gets(indexes []string) map[string]T
func (*IndexedList[T]) HalveReadCounts ¶ added in v0.9.0
func (l *IndexedList[T]) HalveReadCounts()
func (*IndexedList[T]) Len ¶
func (l *IndexedList[T]) Len() int
func (*IndexedList[T]) OrderedReadWriteCounts ¶
func (l *IndexedList[T]) OrderedReadWriteCounts() []uint32
returns read write counts in order that they appear in the current buffer's list
func (*IndexedList[T]) Pop ¶
func (l *IndexedList[T]) Pop(amount int) []T
func (*IndexedList[T]) PopWhere ¶
func (l *IndexedList[T]) PopWhere(predicate func(T) bool, amount int) []T
func (*IndexedList[T]) ReadWriteCounts ¶
func (l *IndexedList[T]) ReadWriteCounts(indexes []string) map[string]uint32
returns the read write count for the given indexes; does not affect the count
func (*IndexedList[T]) Remove ¶
func (l *IndexedList[T]) Remove(indexes []string)
func (*IndexedList[T]) Set ¶
func (l *IndexedList[T]) Set(values []T)
func (*IndexedList[T]) SortByReadCount ¶
func (l *IndexedList[T]) SortByReadCount()
Insertion sort from the least read to the most read
type LRMap ¶ added in v0.9.0
LRMap is a left-right concurrent map. Readers are lock-free (RLock). Writers are serialized by a mutex.
func (*LRMap[T]) Get ¶ added in v0.9.0
Get returns a copy of the value for the given key. Safe from any goroutine.
func (*LRMap[T]) Gets ¶ added in v0.9.0
Gets returns values for the given keys. Safe from any goroutine.
Click to show internal directories.
Click to hide internal directories.