Documentation
¶
Overview ¶
Package lru provides wrapper types for go-ethereum's lru implementation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicLRU ¶
type BasicLRU[K comparable, V any] struct { // contains filtered or unexported fields }
BasicLRU is a simple LRU cache
func NewBasicLRU ¶
func NewBasicLRU[K comparable, V any](capacity int) *BasicLRU[K, V]
NewBasicLRU creates a new BasicLRU
func (*BasicLRU[K, V]) Add ¶
func (c *BasicLRU[K, V]) Add(key K, value V)
Add adds a value to the cache
type Cache ¶
type Cache[K comparable, V any] struct { *BasicLRU[K, V] }
Cache is a thread-safe LRU cache
type SizeConstrainedCache ¶
type SizeConstrainedCache[K comparable, V any] struct { *BasicLRU[K, V] // contains filtered or unexported fields }
SizeConstrainedCache is a size-constrained cache
func NewSizeConstrainedCache ¶
func NewSizeConstrainedCache[K comparable, V any](maxSize uint64) *SizeConstrainedCache[K, V]
NewSizeConstrainedCache creates a new size-constrained cache
Click to show internal directories.
Click to hide internal directories.