Versions in this module Expand all Collapse all v0 v0.29.0 Aug 18, 2020 Changes in this version + var ErrCacheFull = errors.New("Cache capacity is fully occupied with pinned elements") + type Cache interface + 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{})