kops/vendor/github.com/hashicorp/golang-lru
Justin Santa Barbara bad8debd19
Update vendor
2020-01-17 06:38:43 -05:00
..
simplelru Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
.gitignore Populate vendor 2017-07-02 13:10:28 -04:00
2q.go Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
BUILD.bazel Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
LICENSE Populate vendor 2017-07-02 13:10:28 -04:00
README.md Populate vendor 2017-07-02 13:10:28 -04:00
arc.go Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
doc.go Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
go.mod Generated vendor & bazel from `make gomod` 2019-08-25 16:00:41 -04:00
lru.go Update vendor 2020-01-17 06:38:43 -05: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()))
}