dnscrypt-proxy/vendor/github.com/hashicorp/golang-lru
Ryan Boehning f44e11fa65 Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
..
simplelru Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
.gitignore Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
2q.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
2q_test.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
LICENSE Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
README.md Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
arc.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
arc_test.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
lru.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
lru_test.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -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()))
}