kops/vendor/github.com/hashicorp/golang-lru
Jesse Haka 52d2cb08a8 update deps 2022-05-04 10:25:42 +03:00
..
simplelru Remove bazel files from vendor 2022-04-12 13:29:03 +02:00
.gitignore update deps 2022-05-04 10:25:42 +03:00
2q.go update deps 2022-05-04 10:25:42 +03:00
LICENSE
README.md update deps 2022-05-04 10:25:42 +03:00
arc.go update deps 2022-05-04 10:25:42 +03:00
doc.go update deps 2022-05-04 10:25:42 +03:00
lru.go update deps 2022-05-04 10:25:42 +03: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()))
}