Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheEntry ¶
CacheEntry holds a cached value with expiration
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache is a thread-safe LRU cache with TTL support
func NewLRUCache ¶
NewLRUCache creates a new LRU cache with the given capacity and TTL
func (*LRUCache) Dump ¶ added in v1.10.5
func (c *LRUCache) Dump() map[string]CacheEntry
Dump returns a slice of cache entries for persistence
func (*LRUCache) Restore ¶ added in v1.10.5
func (c *LRUCache) Restore(dump map[string]CacheEntry)
Restore populates the cache from a map of entries
Click to show internal directories.
Click to hide internal directories.