istanbul-tools/vendor/github.com/hashicorp/golang-lru
Alan Chen 80982aeed0 vendor: update various packages 2017-09-11 17:11:25 +08:00
..
simplelru vendor: update various packages 2017-09-11 17:11:25 +08:00
.gitignore vendor: update packages 2017-08-09 17:10:18 +08:00
2q.go rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
2q_test.go vendor: update packages 2017-08-09 17:10:18 +08:00
LICENSE rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
README.md rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
arc.go rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
arc_test.go vendor: update packages 2017-08-09 17:10:18 +08:00
lru.go rename Istanbul-tools to istanbul-tools 2017-06-26 15:24:54 +08:00
lru_test.go vendor: update various packages 2017-09-11 17:11:25 +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()))
}