Versions in this module Expand all Collapse all v0 v0.1.0 Nov 2, 2017 Changes in this version + type Cache interface + Close func() error + GetIfPresent func(Key) (Value, bool) + Invalidate func(Key) + InvalidateAll func() + Put func(Key, Value) + Stats func(*Stats) + func New(options ...Option) Cache + type Func func(Key, Value) + type Hash interface + Sum64 func() uint64 + type Key interface + type LoaderFunc func(Key) (Value, error) + type LoadingCache interface + Get func(Key) (Value, error) + func NewLoadingCache(loader LoaderFunc, options ...Option) LoadingCache + type Option func(c *localCache) + func WithExpireAfterAccess(d time.Duration) Option + func WithMaximumSize(size int) Option + func WithPolicy(name string) Option + func WithRefreshAfterWrite(d time.Duration) Option + func WithRemovalListener(onRemoval Func) Option + func WithStatsCounter(st StatsCounter) Option + type Stats struct + EvictionCount uint64 + HitCount uint64 + LoadErrorCount uint64 + LoadSuccessCount uint64 + MissCount uint64 + TotalLoadTime time.Duration + func (s *Stats) AverageLoadPenalty() time.Duration + func (s *Stats) HitRate() float64 + func (s *Stats) LoadErrorRate() float64 + func (s *Stats) MissRate() float64 + func (s *Stats) RequestCount() uint64 + func (s *Stats) String() string + type StatsCounter interface + RecordEviction func() + RecordHits func(count uint64) + RecordLoadError func(loadTime time.Duration) + RecordLoadSuccess func(loadTime time.Duration) + RecordMisses func(count uint64) + Snapshot func(*Stats) + type Value interface Incompatible versions in this module v2.0.0+incompatible Oct 26, 2018