Documentation ¶
Overview ¶
Package inmem provides an in memory LRU cache with TTL support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Add(key, value interface{}, expiresAt time.Time) Get(key interface{}) (interface{}, bool) Remove(key interface{}) Len() int }
Cache of things.
func NewLocked ¶
NewLocked constructs a new Cache of the given size that is safe for concurrent use. If will panic if size is not a positive integer.
func NewUnlocked ¶
NewUnlocked constructs a new Cache of the given size that is not safe for concurrent use. If will panic if size is not a positive integer.
Click to show internal directories.
Click to hide internal directories.