Versions in this module Expand all Collapse all v0 v0.6.0 Mar 9, 2018 v0.5.1 Mar 9, 2018 v0.5.0 Jan 17, 2018 Changes in this version + var ErrCacheFull = errors.New("Cache capacity is fully occupied with pinned elements") + type Cache interface + Delete func(key string) + 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{})