Versions in this module Expand all Collapse all v1 v1.11.0 Apr 7, 2025 v1.10.1 Apr 7, 2025 Changes in this version + var ErrCacheFull = errors.New("Cache capacity is fully occupied with pinned elements") + type Cache interface + Clear func() + Delete func(key string) + Exist func(key string) bool + Get func(key string) interface{} + Put func(key string, value interface{}) interface{} + PutIfNotExist func(key string, value interface{}) (interface{}, error) + Release func(key string) + Size func() int + func New(maxSize int, opts *Options) Cache + func NewLRU(maxSize int) Cache + func NewLRUWithInitialCapacity(initialCapacity, maxSize int) Cache + type Options struct + InitialCapacity int + Pin bool + RemovedFunc RemovedFunc + TTL time.Duration + type RemovedFunc func(interface{})