client/vendor/github.com/hashicorp/golang-lru
Markus Thömmes 4ba1cca91e
Update dependencies, pin k8s deps. (#855)
2020-05-26 00:39:49 -07:00
..
simplelru feature(serving): Update API to serving.knative.dev/v1 (#640) 2020-02-07 02:03:14 -08:00
.gitignore Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
2q.go Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
LICENSE Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
README.md Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
arc.go Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
doc.go Actually, vendor everything (#59) 2019-04-05 04:08:57 -07:00
go.mod feature(serving): Update API to serving.knative.dev/v1 (#640) 2020-02-07 02:03:14 -08:00
lru.go Update dependencies, pin k8s deps. (#855) 2020-05-26 00:39:49 -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()))
}