Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TTLCache ¶
type TTLCache[K comparable, V any] struct { // contains filtered or unexported fields }
TTLCache is a generic time-based cache with configurable TTL per key
func NewTTLCache ¶
func NewTTLCache[K comparable, V any]() *TTLCache[K, V]
NewTTLCache creates a new TTL cache
func (*TTLCache[K, V]) CleanExpired ¶
func (c *TTLCache[K, V]) CleanExpired()
CleanExpired removes expired items from the cache
func (*TTLCache[K, V]) Clear ¶
func (c *TTLCache[K, V]) Clear()
Clear removes all items from the cache
func (*TTLCache[K, V]) Delete ¶
func (c *TTLCache[K, V]) Delete(key K)
Delete removes a value from the cache
Click to show internal directories.
Click to hide internal directories.