Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { // contains filtered or unexported fields }
Cache keeps recently used values. Safe for concurrent use by multiple goroutines.
func New ¶
func New[K comparable, V any](capacity int) *Cache[K, V]
New returns a new empty cache that can hold up to capacity items.
Click to show internal directories.
Click to hide internal directories.