Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache is a cache of elements.
func New ¶
func New[K Hasher, V any](create CreationFunc[K, V], isAlive IsAliveFunc[V], close CloseFunc[V], equals EqualsFunc[K]) *Cache[K, V]
New returns a new cache.
type CreationFunc ¶
CreationFunc creates a new value for the given key.
type Element ¶
Element is an entry in the cache.
func (*Element[K, _]) Key ¶
func (e *Element[K, _]) Key() K
Key returns the key for this element. This can be safely called after a call to Release.
type EqualsFunc ¶
EqualsFunc returns true iff two keys are equal.
Click to show internal directories.
Click to hide internal directories.