Versions in this module Expand all Collapse all v0 v0.1.0 Nov 11, 2020 Changes in this version + var ErrKeyNotFound error = errors.New("Key not found") + type Cache interface + Close func() + Get func(key interface{}) (interface{}, error) + Invalidate func(key interface{}, keys ...interface{}) + InvalidateAll func() + Put func(key interface{}, value interface{}) + Stats func() Stats + func New(options CacheOptions) Cache + type CacheOption func(Cache) + type CacheOptions struct + BackgroundEvictFrequency time.Duration + Clock clock.Clock + ExpireAfterRead time.Duration + ExpireAfterWrite time.Duration + HashCodeFunc func(key interface{}) int + Load LoadFunc + MaxSize int32 + RemovalListeners []RemovalListener + ShardCount int + type LoadFunc func(interface{}) (interface{}, error) + type RemovalListener func(RemovalNotification) + type RemovalNotification struct + Key interface{} + Reason RemovalReason + Value interface{} + type RemovalReason string + const RemovalReasonExpired + const RemovalReasonExplicit + const RemovalReasonReplaced + const RemovalReasonSize + type Stats interface + AverageLoadPenalty func() time.Duration + EvictionCount func() int64 + HitCount func() int64 + HitRate func() float64 + LoadCount func() int64 + LoadErrorCount func() int64 + LoadErrorRate func() float64 + LoadSuccessCount func() int64 + LoadTotalTime func() time.Duration + MissCount func() int64 + MissRate func() float64 + RequestCount func() int64