Cache library for golang. It supports LFU currently.
-
Supports LFU.
-
Goroutine safe.
$ go get github.com/solutionstack/lcache
package main
import (
"github.com/solutionstack/lcache"
"fmt"
)
func main() {
lc := lcache.NewCache(20) //optional size parameter to NewCache
lc.Write("key", "ok")
result := lc.Read("key")
if result.Error != nil {
panic( result.Error )
}
fmt.Println("Read:", result.Value)
}
Olubodn Agbalaya