Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRUCache ¶
type LRUCache struct {
Capacity int32
// contains filtered or unexported fields
}
LRUCache is a simple thread-safe LRU cache. It uses a single RWMutex to guard both the list and the map to avoid deadlocks and inconsistent views.
func NewLRUCache ¶
func (*LRUCache) Get ¶
Get returns value, found flag and error. When key is found, it is moved to front as most recently used.
func (*LRUCache) Peek ¶ added in v1.1.1
Peek returns value, found flag and error without updating LRU order. It is useful for read-only inspection that should not affect eviction order.
Click to show internal directories.
Click to hide internal directories.