Top 0.4% dependent packages on proxy.golang.org
Top 0.5% dependent repos on proxy.golang.org
Top 6.9% forks on proxy.golang.org
Top 0.3% docker downloads on proxy.golang.org
proxy.golang.org : github.com/go-pkgz/expirable-cache
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.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/go-pkgz/expirable-cache
Keywords:
cache
, expirable-cache
, go
, go-library
, lrc-cache
, lru-cache
License: MIT
Latest release: over 2 years ago
First release: about 5 years ago
Namespace: github.com/go-pkgz
Dependent packages: 160
Dependent repositories: 177
Stars: 56 on GitHub
Forks: 8 on GitHub
Docker dependents: 42
Docker downloads: 79,206,929
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/umputun
Last synced: 24 days ago