Documentation
¶
Overview ¶
Package cache implements a generic thread-safe cache.
Index ¶
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 { // contains filtered or unexported fields }
Cache holds a map with a comparable key and an unconstrained value.
func New ¶
func New[K comparable, V any]() *Cache[K, V]
New returns a new Cache with specified type parameters.
func (*Cache[K, V]) Delete ¶
func (c *Cache[K, V]) Delete(key K)
Delete removes a value from the cache.
Click to show internal directories.
Click to hide internal directories.