1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2024-12-11 22:35:40 +01:00
dnscrypt-proxy/vendor/github.com/hashicorp/golang-lru
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_test.go 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
arc_test.go 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
doc.go Add missing golang-lru files 2018-02-02 18:18:38 +01:00
LICENSE Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08:00
lru_test.go Update golang-lru 2018-02-02 17:46:45 +01:00
lru.go Update golang-lru 2018-02-02 17:46:45 +01:00
README.md Switch from glide to dep. Check in vendor/ 2018-01-11 13:39:18 -08: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()))
}