dnscrypt-proxy/vendor/github.com/hashicorp/golang-lru
Frank Denis cb911e6ed0 Add missing golang-lru files 2018-02-02 18:18:38 +01:00
..
simplelru Add missing golang-lru files 2018-02-02 18:18:38 +01:00
.gitignore Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
2q.go Update golang-lru 2018-02-02 17:46:45 +01: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 Update golang-lru 2018-02-02 17:46:45 +01:00
arc_test.go Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
doc.go Add missing golang-lru files 2018-02-02 18:18:38 +01:00
lru.go Update golang-lru 2018-02-02 17:46:45 +01:00
lru_test.go Update golang-lru 2018-02-02 17:46:45 +01: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()))
}