Versions in this module Expand all Collapse all v1 v1.0.2 Feb 8, 2021 Changes in this version + type Cache struct + func NewCache(cacher Cacher) *Cache + func (r *Cache) Capacity() int + func (r *Cache) Close() error + func (r *Cache) CloseWeak() error + func (r *Cache) Delete(ns, key uint64, onDel func()) bool + func (r *Cache) Evict(ns, key uint64) bool + func (r *Cache) EvictAll() + func (r *Cache) EvictNS(ns uint64) + func (r *Cache) Get(ns, key uint64, setFunc func() (size int, value Value)) *Handle + func (r *Cache) Nodes() int + func (r *Cache) SetCapacity(capacity int) + func (r *Cache) Size() int + type Cacher interface + Ban func(n *Node) + Capacity func() int + Close func() error + Evict func(n *Node) + EvictAll func() + EvictNS func(ns uint64) + Promote func(n *Node) + SetCapacity func(capacity int) + func NewLRU(capacity int) Cacher + type Handle struct + func (h *Handle) Release() + func (h *Handle) Value() Value + type NamespaceGetter struct + Cache *Cache + NS uint64 + func (g *NamespaceGetter) Get(key uint64, setFunc func() (size int, value Value)) *Handle + type Node struct + CacheData unsafe.Pointer + func (n *Node) GetHandle() *Handle + func (n *Node) Key() uint64 + func (n *Node) NS() uint64 + func (n *Node) Ref() int32 + func (n *Node) Size() int + func (n *Node) Value() Value + type Value interface