karmada/vendor/github.com/hashicorp/golang-lru
RainbowMango 8553359816 Update vendor.
bump github.com/go-logr/logr to v0.3.0 solving dependency issue
2020-12-03 21:40:37 +08:00
..
simplelru Update vendor. 2020-12-03 21:40:37 +08:00
.gitignore update vendor/ 2020-11-11 10:46:27 +08:00
2q.go update vendor/ 2020-11-11 10:46:27 +08:00
LICENSE update vendor/ 2020-11-11 10:46:27 +08:00
README.md update vendor/ 2020-11-11 10:46:27 +08:00
arc.go update vendor/ 2020-11-11 10:46:27 +08:00
doc.go update vendor/ 2020-11-11 10:46:27 +08:00
go.mod Update vendor. 2020-12-03 21:40:37 +08:00
lru.go Update vendor. 2020-12-03 21:40:37 +08: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()))
}