Versions in this module Expand all Collapse all v0 v0.0.1 Jul 6, 2023 Changes in this version + var ErrCacheCapacityInvalid = errors.New("cache capacity is less than 1") + var ErrCacheSizeInvalid = errors.New("cache size is less than 1") + type Cacher interface + Clear func() + Close func() error + Get func(key []byte) (value interface{}, ok bool) + Has func(key []byte) bool + HasOrAdd func(key []byte, value interface{}, sizeInBytes int) (has, added bool) + IsInterfaceNil func() bool + Keys func() [][]byte + Len func() int + MaxSize func() int + Peek func(key []byte) (value interface{}, ok bool) + Put func(key []byte, value interface{}, sizeInBytes int) (evicted bool) + RegisterHandler func(handler func(key []byte, value interface{}), id string) + Remove func(key []byte) + SizeInBytesContained func() uint64 + UnRegisterHandler func(id string) + type ForEachItem func(key []byte, value interface{}) + type KeyValuePair struct + Key []byte + Value []byte + type LRUCacheHandler interface + Add func(key, value interface{}) bool + Contains func(key interface{}) (ok bool) + ContainsOrAdd func(key, value interface{}) (ok, evicted bool) + Get func(key interface{}) (value interface{}, ok bool) + Keys func() []interface{} + Len func() int + Peek func(key interface{}) (value interface{}, ok bool) + Purge func() + Remove func(key interface{}) bool + type SizedLRUCacheHandler interface + AddSized func(key, value interface{}, sizeInBytes int64) bool + AddSizedIfMissing func(key, value interface{}, sizeInBytes int64) (ok, evicted bool) + Contains func(key interface{}) (ok bool) + Get func(key interface{}) (value interface{}, ok bool) + Keys func() []interface{} + Len func() int + Peek func(key interface{}) (value interface{}, ok bool) + Purge func() + Remove func(key interface{}) bool + SizeInBytesContained func() uint64