package main
import (
"fmt"
"github.com/s2gatev/hcache"
)
type data struct {
value int
}
func main() {
cache := hcache.New()
cache.Insert(&data{value: 42}, "important", "answer")
// ...
if v, ok := cache.Get("important", "answer"); ok {
d := v.(*data)
fmt.Println(d.value) // 42
}
}epgoranova/hcache
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|