twz915 / golang-lru

Golang LRU cache with expire feature.

Home Page:https://hnlq715.github.io/golang-lru/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang-lru

Build Status Coverage

This provides the lru package which implements a fixed-size thread safe LRU cache with expire feature. It is based on golang-lru.

Documentation

Full docs are available on Godoc

Example

Using the LRU is very simple:

l, _ := NewARCWithExpire(128, 30*time.Second)
for i := 0; i < 256; i++ {
    l.Add(i, nil)
}
if l.Len() != 128 {
    panic(fmt.Sprintf("bad len: %v", l.Len()))
}

About

Golang LRU cache with expire feature.

https://hnlq715.github.io/golang-lru/

License:Mozilla Public License 2.0


Languages

Language:Go 100.0%