caching/vendor/github.com/hashicorp/golang-lru
Matt Moore 08192258fa
[master] Auto-update dependencies (#265)
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott vagababov
/cc n3wscott vagababov
2020-05-05 08:53:44 -07: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
go.mod [master] Auto-update dependencies (#261) 2020-04-29 09:02:42 -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()))
}