Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
simplelru/ | H | 16-Jan-2020 | - | |||
.gitignore | H A D | 16-Jan-2020 | 259 | |||
2q.go | H A D | 16-Jan-2020 | 5.5 KiB | |||
2q_test.go | H A D | 16-Jan-2020 | 5.3 KiB | |||
LICENSE | H A D | 16-Jan-2020 | 15.5 KiB | |||
README.md | H A D | 16-Jan-2020 | 455 | |||
arc.go | H A D | 16-Jan-2020 | 5.6 KiB | |||
arc_test.go | H A D | 16-Jan-2020 | 6.5 KiB | |||
doc.go | H A D | 16-Jan-2020 | 948 | |||
go.mod | H A D | 16-Jan-2020 | 48 | |||
lru.go | H A D | 16-Jan-2020 | 3.6 KiB | |||
lru_test.go | H A D | 16-Jan-2020 | 5.4 KiB |
README.md
1golang-lru 2========== 3 4This provides the `lru` package which implements a fixed-size 5thread safe LRU cache. It is based on the cache in Groupcache. 6 7Documentation 8============= 9 10Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) 11 12Example 13======= 14 15Using the LRU is very simple: 16 17```go 18l, _ := New(128) 19for i := 0; i < 256; i++ { 20 l.Add(i, nil) 21} 22if l.Len() != 128 { 23 panic(fmt.Sprintf("bad len: %v", l.Len())) 24} 25``` 26