Lrucache is a powerful key/value store for Go.
You can use it almost the same way as an in-memory dictionary (map[string]interface{}) but there are many important differences in implementation.
map[string]interface{}
 | 
lrucache | |
|---|---|---|
| thread-safe | no | yes | 
| maximum size | no | yes | 
| OnMiss handler | no | yes | 
- purges least recently used element when full
 - elements can report their own size
 - everything is cacheable (
interface{}) - is a front for your persistent storage (S3, disk, ...) by using OnMiss hooks
 
Examples and API are on godoc:
http://godoc.org/github.com/hraban/lrucache
The licensing terms are described in the file LICENSE.
Copyright © 2012-2020 Hraban Luyat [email protected]