Documentation ¶
Index ¶
- type Cache
- type NoCache
- func (n *NoCache[K, V]) Add(_ K, _ V) (updated, evicted bool)
- func (n *NoCache[K, V]) Contains(_ K) bool
- func (n *NoCache[K, V]) ContainsOrAdd(key K, value V) (ok, evicted bool)
- func (n *NoCache[K, V]) Get(_ K) (value V, ok bool)
- func (n *NoCache[K, V]) Keys() []K
- func (n *NoCache[K, V]) Len() int
- func (n *NoCache[K, V]) Peek(_ K) (value V, ok bool)
- func (n *NoCache[K, V]) Purge()
- func (n *NoCache[K, V]) Remove(key K)
- func (n *NoCache[K, V]) RemoveOldest()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { Purge() Add(key K, value V) (updated, evicted bool) Get(key K) (value V, ok bool) Contains(key K) bool Peek(key K) (value V, ok bool) ContainsOrAdd(key K, value V) (ok, evicted bool) Remove(key K) RemoveOldest() Keys() []K Len() int }
func NewNoCache ¶
func NewNoCache[K comparable, V any]() Cache[K, V]
type NoCache ¶
type NoCache[K comparable, V any] struct{}
func (*NoCache[K, V]) ContainsOrAdd ¶
func (*NoCache[K, V]) RemoveOldest ¶
func (n *NoCache[K, V]) RemoveOldest()
Click to show internal directories.
Click to hide internal directories.