statsd_exporter/vendor/github.com/hashicorp/golang-lru
Matthias Rampke 7f7d5171c3
go mod vendor
Signed-off-by: Matthias Rampke <matthias@prometheus.io>
2020-05-29 08:00:30 +00:00
..
simplelru go mod vendor 2020-05-29 08:00:30 +00:00
.gitignore Adding mapping cache 2019-04-26 18:00:39 -04:00
2q.go Adding mapping cache 2019-04-26 18:00:39 -04:00
arc.go Adding mapping cache 2019-04-26 18:00:39 -04:00
doc.go Adding mapping cache 2019-04-26 18:00:39 -04:00
go.mod go mod vendor 2020-05-29 08:00:30 +00:00
LICENSE Adding mapping cache 2019-04-26 18:00:39 -04:00
lru.go go mod vendor 2020-05-29 08:00:30 +00:00
README.md Adding mapping cache 2019-04-26 18:00:39 -04:00

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()))
}