status-eth-node/vendor/github.com/hashicorp/golang-lru
Pedro Pombeiro 5053b0b683
Create types.Node type
2019-11-20 11:07:13 +01:00
..
simplelru Create types.Node type 2019-11-20 11:07:13 +01:00
.gitignore Create types.Node type 2019-11-20 11:07:13 +01:00
2q.go Create types.Node type 2019-11-20 11:07:13 +01:00
LICENSE Create types.Node type 2019-11-20 11:07:13 +01:00
README.md Create types.Node type 2019-11-20 11:07:13 +01:00
arc.go Create types.Node type 2019-11-20 11:07:13 +01:00
doc.go Create types.Node type 2019-11-20 11:07:13 +01:00
go.mod Create types.Node type 2019-11-20 11:07:13 +01:00
lru.go Create types.Node type 2019-11-20 11:07:13 +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()))
}