1
0
mirror of https://github.com/rancher/rke.git synced 2025-06-20 12:44:30 +00:00
rke/vendor/github.com/hashicorp/golang-lru
2020-02-26 14:14:42 -08:00
..
simplelru Go mod and vendor changes 2020-02-26 14:14:42 -08:00
.gitignore Vendor update 2017-11-13 23:23:16 +02:00
2q.go Switch to go modules 2019-08-19 11:02:43 -07:00
arc.go Switch to go modules 2019-08-19 11:02:43 -07:00
doc.go Switch to go modules 2019-08-19 11:02:43 -07:00
go.mod Go mod and vendor changes 2020-02-26 14:14:42 -08:00
LICENSE Vendor update 2017-11-13 23:23:16 +02:00
lru.go Go mod and vendor changes 2020-02-26 14:14:42 -08:00
README.md Vendor update 2017-11-13 23:23:16 +02: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()))
}