lru

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make[K comparable, V any](capacity int) map_cache.Map[K, V]

func MakeSafe

func MakeSafe[K comparable, V any](capacity int) map_cache.SafeMap[K, V]

Types

type SafeLRUCache

type SafeLRUCache[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*SafeLRUCache[K, V]) All

func (safeMap *SafeLRUCache[K, V]) All() iter.Seq[V]

func (*SafeLRUCache[K, V]) Delete

func (safeMap *SafeLRUCache[K, V]) Delete(key K)

func (*SafeLRUCache[K, V]) Get

func (safeMap *SafeLRUCache[K, V]) Get(key K) (v V, ok bool)

func (*SafeLRUCache[K, V]) Len

func (safeMap *SafeLRUCache[K, V]) Len() int

func (*SafeLRUCache[K, V]) Locker

func (c *SafeLRUCache[K, V]) Locker() sync.Locker

func (*SafeLRUCache[K, V]) Put

func (safeMap *SafeLRUCache[K, V]) Put(key K, value V)

func (*SafeLRUCache[K, V]) RLocker

func (c *SafeLRUCache[K, V]) RLocker() sync.Locker

func (*SafeLRUCache[K, V]) Scan

func (safeMap *SafeLRUCache[K, V]) Scan() iter.Seq2[K, V]

type Unsafe

type Unsafe[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Unsafe[K, V]) All

func (cache *Unsafe[K, V]) All() iter.Seq[V]

func (*Unsafe[K, V]) Delete

func (cache *Unsafe[K, V]) Delete(key K)

func (*Unsafe[K, V]) Get

func (cache *Unsafe[K, V]) Get(key K) (v V, ok bool)

func (*Unsafe[K, V]) Len

func (cache *Unsafe[K, V]) Len() int

func (*Unsafe[K, V]) Put

func (cache *Unsafe[K, V]) Put(key K, value V)

func (*Unsafe[K, V]) Scan

func (cache *Unsafe[K, V]) Scan() iter.Seq2[K, V]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL