go-generics-cache
go-generics-cache copied to clipboard
A key:value store/cache library written in Go generics. LRU, LFU, FIFO, MRU, Clock support.
`constraints` package is not planned to land in std : https://github.com/golang/go/issues/50792 Would you consider removing the dependency? Thanks!
## Feature Request: GetOrSetFunc Support for lazy initialization e.g.: for an IP based rate limiter implementation: I want to be able to do this: ``` rateLimitForIP, _ := st.rateLimiters.GetOrSetFunc( ip,...
Closes #66
https://github.com/Code-Hex/go-generics-cache/blob/f567a8625646b7c3e8828091d4cfa604056fad71/cache.go#L235-L245 GetOrSet doesn't respect expire setting and will not be removed even expired.