Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimeCache ¶
type TimeCache[K comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable](size int, expiry time.Duration) *TimeCache[K]
New allocates a new Timecache with initial allocation size and expiry time. If `size` gets filled the timecache will allocate more memory to fit more elements into it. The cache will not shrink after regrowing. It is safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.