ceph-csi/vendor/github.com/hashicorp/golang-lru
Madhu Rajanna d5a0606c33 Migrate from dep to go module
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-03-17 10:44:07 +00:00
..
simplelru Add recover middleware for grpc server 2019-08-01 11:02:27 +00:00
.gitignore Migrate from dep to go module 2020-03-17 10:44:07 +00:00
2q.go vendor update for E2E framework 2019-06-04 11:39:42 +05:30
arc.go vendor update for E2E framework 2019-06-04 11:39:42 +05:30
doc.go vendor update for E2E framework 2019-06-04 11:39:42 +05:30
go.mod Migrate from dep to go module 2020-03-17 10:44:07 +00:00
LICENSE vendor update for E2E framework 2019-06-04 11:39:42 +05:30
lru.go Add recover middleware for grpc server 2019-08-01 11:02:27 +00:00
README.md Migrate from dep to go module 2020-03-17 10:44:07 +00: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()))
}