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 io.Closer](create CreationFunc[K, V], equals EqualsFunc[K], lg log.Interface) *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. It is safe to call this 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.