 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Priority
- type PriorityMap
- func (p *PriorityMap[K, V, P]) Delete(key K)
- func (p *PriorityMap[K, V, P]) Find(cond func(V) bool) (V, bool)
- func (p *PriorityMap[K, V, P]) Get(key K) (V, bool)
- func (p *PriorityMap[K, V, P]) Len() int
- func (p *PriorityMap[K, V, P]) Next() (K, V, bool)
- func (p *PriorityMap[K, V, P]) Set(key K, val V, pri P)
 
- type SyncMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityMap ¶ added in v0.1.1
type PriorityMap[K comparable, V any, P Priority] struct { // contains filtered or unexported fields }
PriorityMap provides a map with a built-in priority queue for trimming.
func NewPriorityMap ¶ added in v0.1.1
func NewPriorityMap[K comparable, V any, P Priority]() PriorityMap[K, V, P]
NewPriorityMap creates a new empty priority queue.
func (*PriorityMap[K, V, P]) Delete ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Delete(key K)
Delete an element from the map.
func (*PriorityMap[K, V, P]) Find ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Find(cond func(V) bool) (V, bool)
Find a value in the map with a given condition.
func (*PriorityMap[K, V, P]) Get ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Get(key K) (V, bool)
Get an element in the map by its key.
func (*PriorityMap[K, V, P]) Len ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Len() int
Len returns the number of elements in the queue.
func (*PriorityMap[K, V, P]) Next ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Next() (K, V, bool)
Next returns the next value in the map with the lowest priority.
func (*PriorityMap[K, V, P]) Set ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Set(key K, val V, pri P)
Set an element in the map to the given value and priority.
type SyncMap ¶
type SyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
Thread-safe generic map.
func NewSyncMap ¶
func NewSyncMap[K comparable, V any]() SyncMap[K, V]
 Click to show internal directories. 
   Click to hide internal directories.