capacity
untyped bigintcapacity is the fixed maximum number of entries the cache holds.
Value
(8 <untyped> bigint)
node
typenode is a doubly-linked-list node holding a key/value pair. The list is ordered MRU (head) -> LRU (tail).
Value
v0.node
cache
typecache is a fixed-capacity LRU cache backed by a doubly-linked list and an index from key -> node for O(1) lookups.
Value
v0.cache
c
*v0.cache- OID
- 0a9412…ce95:4
c details
Put
func(key string, value string)Put inserts or updates key with value and marks it most-recently-used. Evicts the least-recently-used entry if capacity is exceeded.
- OID
- 0a9412…ce95:7
Put details
Get
func(key string) (string, bool)Get returns the value for key and marks it most-recently-used. It records a hit or a miss. The returned bool reports whether the key was present.
- OID
- 0a9412…ce95:9
Get details
Reset
func()Reset clears the cache and stats.
- OID
- 0a9412…ce95:10
Reset details
peek
func(key string) (string, bool)peek returns the value without affecting recency or stats (read helper).
- OID
- 0a9412…ce95:11
peek details
Render
func(path string) stringRender displays the cache contents in MRU->LRU order with stats.
- OID
- 0a9412…ce95:12
Render details
capacity
:
untyped bigint
=(8 <untyped> bigint)
node
:
type
=v0.node
cache
:
type
=v0.cache