Versions in this module Expand all Collapse all v1 v1.0.1 Jul 31, 2023 v1.0.0 Apr 12, 2023 Changes in this version + type Cache struct + func NewCache(cacher Cacher) *Cache + func (r *Cache) Capacity() int + func (r *Cache) Close(force bool) + func (r *Cache) Delete(ns, key uint64, delFunc 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) GetStats() Stats + 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 + Evict func(n *Node) + 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 Stats struct + Buckets int + DelCount int64 + GrowCount int32 + HitCount int64 + MissCount int64 + Nodes int64 + SetCount int64 + ShrinkCount int32 + Size int64 + type Value any