Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content[V any] struct { Data V // contains filtered or unexported fields }
Content is the value stored for a given key in the ExpiryMap.
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map is a map of K key and V values with a builtin garbage cleaner that automatically deletes entries after a given expiry delay.
func New ¶
func New[K comparable, V any](expiryDelay, gargabeCleanInterval time.Duration) *Map[K, V]
New returns a new ExpiryMap. It also starts a goroutine that periodically cleans up expired entries according to the expiryDelay every gargabeCleanInterval.
func (*Map[K, V]) Delete ¶
func (s *Map[K, V]) Delete(key K)
Delete deletes the value for a given key.
Click to show internal directories.
Click to hide internal directories.