open-nomad/vendor/github.com/hashicorp/golang-lru
Seth Hoenig 435c0d9fc8 deps: Switch to Go modules for dependency management
This PR switches the Nomad repository from using govendor to Go modules
for managing dependencies. Aspects of the Nomad workflow remain pretty
much the same. The usual Makefile targets should continue to work as
they always did. The API submodule simply defers to the parent Nomad
version on the repository, keeping the semantics of API versioning that
currently exists.
2020-06-02 14:30:36 -05:00
..
simplelru deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
.gitignore deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
2q.go deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
arc.go deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
doc.go deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
go.mod deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05:00
LICENSE
lru.go deps: Switch to Go modules for dependency management 2020-06-02 14:30:36 -05: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()))
}