package
0.0.0-20231103071447-2fcbf702e5ec
Repository: https://github.com/autlin/core.git
Documentation: pkg.go.dev

# Functions

New creates an LruCache.
WithAge defined element max age (second).
WithEvict set the evict callback.
WithSize defined max length of LruCache.
WithStale decide whether Stale return is enabled.
WithUpdateAgeOnGet update expires when Get element.

# Structs

LruCache is a thread-safe, in-memory lru-cache that evicts the least recently used entries from memory when (if set) the entries are older than maxAge (in seconds).

# Type aliases

EvictCallback is used to get a callback when a cache entry is evicted.
Option is part of Functional Options Pattern.