kops/vendor/github.com/hashicorp/golang-lru
Justin Santa Barbara 6b6f9db0ef Run make dep-ensure to use dep for vendor directory 2018-02-04 22:08:16 -05:00
..
simplelru Run make dep-ensure to use dep for vendor directory 2018-02-04 22:08:16 -05:00
.gitignore Populate vendor 2017-07-02 13:10:28 -04:00
2q.go Populate vendor 2017-07-02 13:10:28 -04:00
BUILD.bazel Run make dep-ensure to use dep for vendor directory 2018-02-04 22:08:16 -05: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 Populate vendor 2017-07-02 13:10:28 -04:00
lru.go Populate vendor 2017-07-02 13:10:28 -04: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()))
}