caching/vendor/github.com/hashicorp/golang-lru
Paul Schweigert 230ac69ffc
bump go.mod to v1.18 (#660)
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>
2022-08-03 17:51:18 +00:00
..
simplelru [master] Auto-update dependencies (#261) 2020-04-29 09:02:42 -07:00
.gitignore Migrate caching to go mod (#258) 2020-04-27 14:35:51 -07:00
2q.go Add the initial caching type definitions. (#5) 2018-09-07 09:56:33 -07:00
LICENSE Add the initial caching type definitions. (#5) 2018-09-07 09:56:33 -07:00
README.md Migrate caching to go mod (#258) 2020-04-27 14:35:51 -07:00
arc.go Add the initial caching type definitions. (#5) 2018-09-07 09:56:33 -07:00
doc.go Add the initial caching type definitions. (#5) 2018-09-07 09:56:33 -07:00
lru.go [master] Auto-update dependencies (#265) 2020-05-05 08:53:44 -07:00

README.md

golang-lru

This provides the lru package which implements a fixed-size thread safe LRU cache. It is based on the cache in Groupcache.

Documentation

Full docs are available on Godoc

Example

Using the LRU is very simple:

l, _ := New(128)
for i := 0; i < 256; i++ {
    l.Add(i, nil)
}
if l.Len() != 128 {
    panic(fmt.Sprintf("bad len: %v", l.Len()))
}