Documentation ¶
Index ¶
- type Cache
- func (c *Cache[K, V]) Cleanup()
- func (c *Cache[K, V]) Delete(key K)
- func (c *Cache[K, V]) Get(key K) (value V, err error)
- func (c *Cache[K, V]) GetEntry(key K) (value *Entry[V], err error)
- func (c *Cache[K, V]) GetEntryIf(key K) (value *Entry[V], ok bool)
- func (c *Cache[K, V]) GetIf(key K) (value V, ok bool)
- func (c *Cache[K, V]) Replace(key K, value V)
- func (c *Cache[K, V]) ReplaceEntry(key K, v *Entry[V])
- func (c *Cache[K, V]) Set(key K, value V) (result V, ok bool)
- func (c *Cache[K, V]) SetEntry(key K, v *Entry[V]) (result *Entry[V], ok bool)
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { Expiry time.Duration CleanupInterval time.Duration New func(K, *Entry[V]) error Evict func(K, V) Singleflight bool // contains filtered or unexported fields }
func (*Cache[K, V]) GetEntryIf ¶
func (*Cache[K, V]) ReplaceEntry ¶
Click to show internal directories.
Click to hide internal directories.