GOLFU
In-memory cache system
- plug your cold storage on it to eventually persist all setted data
- prevent some resources to be removed from the cache by implementing Evictable.CanBeEvicted on the element
- auto eviction by read count (LFU)
- retrieves all cache-miss from the cold storage provided and sets new elements both in cold storage and cache
- invalidate cache entries without deleting from cold storage
- lock-free concurrent reads via left-right map
Module tour
definition of the cached storage and cold storage
any Indexable is storable, any Evictable can be kept explicitely in memory
implementations of some cold storages
notes
Don't use in production.
Feel free to submit a PR or put a comment or whatever if you find a bug or wanna improve it somehow
release
increase version in README.md:
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes
- MINOR version when you add functionality in a backward compatible manner
- PATCH version when you make backward compatible bug fixes
go mod tidy
go test ./...
git commit -m "what I just did - vX.Y.Z"
git tag vX.Y.Z
git push origin vX.Y.Z
GOPROXY=proxy.golang.org go list -m github.com/JGpGH/golfu@vX.Y.Z
current version
v0.10.0
/\
( / @ @ ()
\ __| |__ /
-/ " \-
/-| |-\
/ /-\ /-\ \
/ /-`---'-\ \ crab of luck
/ \