Documentation
¶
Overview ¶
Package weakmap implements a weak reference map in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map implements a LRU weak map safe for concurrent use. The zero value is an empty map ready for use.
When the Go GC runs, the oldest entries proportional to memory pressure are evicted.
func (*Map[K, V]) Delete ¶
func (l *Map[K, V]) Delete(key K)
Delete removes an entry from the cache.
func (*Map[K, V]) Do ¶
Do is a helper that retrieves a value from the cache, if it exists, and calls the provided function to compute the value if it does not.
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
gctest
command
|
|
|
internal
|
|
|
doublelist
Package doublelist implements a doubly-linked list.
|
Package doublelist implements a doubly-linked list. |
Click to show internal directories.
Click to hide internal directories.