LIB · Go
Gache
In simple terms
Very simple cache for Go programs: keeps data in memory or a file and forgets it automatically when it expires. Zero dependencies and easy to use.
Technical details
Generic New[T](&Options{Path, Lifetime}) library: in-memory when Path is empty or JSON/gob-persisted with atomic tmp+Rename writes. Configurable TTL, out-of-lock expiration hook and 0755/0644 permissions. Updated to Go 1.26 with hardening against corrupt files.
Go 1.26Generics
Highlights
- Generic New[T] with Options{Lifetime, Path, ExpirationHook, Encoder}
- Atomic writes and handling of expired/corrupt entries
- JSON by default and gob via WithGob or custom codec
Install
go get github.com/yukiteruamano/gache Lines of code
1,278
Go 100%
Last recorded activity
Last recorded activity 7 commits · 52 sem
Last recorded activity in the project.