Versions in this module Expand all Collapse all v1 v1.1.5 Oct 26, 2021 Changes in this version + const Forever + const Infinite + type Cache interface + Get func(key string) (interface{}, error) + Keys func() []string + Len func() int + Remove func(key string) error + Set func(key string, value interface{}, ttl *time.Duration) error + Size func() uintptr + Truncate func() error + func New() (Cache, error) + func NewWithOption(option Option) (Cache, error) + type Option struct + MaxEntriesInWindow int64 + MaxEntriesKey int + MaxEntrySize int + MaxPercentageMemory float64 + OnMemoryExceed func(memoryUsedPercentage float64, maxMemoryPercentage float64, memoryUsed float64) + OnRemove func(key string, value interface{}) + OnRemoveWithReason func(key string, reason string)