Package Usage: go: github.com/go-pkgz/expirable-cache/v3
Package cache implements Cache similar to hashicorp/golang-lru
Support LRC, LRU and TTL-based eviction.
Package is thread-safe and doesn't spawn any goroutines.
On every Set() call, cache deletes single oldest entry in case it's expired.
In case MaxSize is set, cache deletes the oldest entry disregarding its expiration date to maintain the size,
either using LRC or LRU eviction.
In case of default TTL (10 years) and default MaxSize (0, unlimited) the cache will be truly unlimited
and will never delete entries from itself automatically.
Important: only reliable way of not having expired entries stuck in a cache is to
run cache.DeleteExpired periodically using time.Ticker, advisable period is 1/2 of TTL.
1 version
Latest release: about 1 year ago
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/go-pkgz/expirable-cache/v3