dnscrypt-proxy/vendor/github.com/hashicorp/golang-lru
Frank Denis c323bcde21 Update deps 2020-01-29 01:07:08 +01:00
..
simplelru Update deps 2019-09-07 11:04:40 +02: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
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
doc.go Add missing golang-lru files 2018-02-02 18:18:38 +01:00
go.mod Update deps 2019-09-07 11:04:40 +02:00
lru.go Update deps 2020-01-29 01:07:08 +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()))
}