Documentation ¶
Index ¶
Constants ¶
View Source
const Forever = 87660 * time.Hour
View Source
const Infinite = math.MaxInt32
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Set(key string, value interface{}, ttl *time.Duration) error Get(key string) (interface{}, error) Remove(key string) error Truncate() error Len() int Size() uintptr Keys() []string }
func NewWithOption ¶
type Option ¶
type Option struct { MaxEntrySize int MaxEntriesKey int MaxEntriesInWindow int64 MaxPercentageMemory float64 OnRemove func(key string, value interface{}) OnRemoveWithReason func(key string, reason string) OnMemoryExceed func(memoryUsedPercentage float64, maxMemoryPercentage float64, memoryUsed float64) }
Click to show internal directories.
Click to hide internal directories.