Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvictCallback ¶
type EvictCallback[K comparable, V any] simplelru.EvictCallback[K, V]
type ExpirationLRU ¶
type ExpirationLRU[K comparable, V any] struct { // contains filtered or unexported fields }
func (*ExpirationLRU[K, V]) Del ¶
func (x *ExpirationLRU[K, V]) Del(key K) bool
func (*ExpirationLRU[K, V]) Get ¶
func (x *ExpirationLRU[K, V]) Get(key K, fetch func() (V, error)) (V, error)
func (*ExpirationLRU[K, V]) SetHas ¶ added in v3.8.0
func (x *ExpirationLRU[K, V]) SetHas(key K, value V) bool
func (*ExpirationLRU[K, V]) Stop ¶
func (x *ExpirationLRU[K, V]) Stop()
type LRU ¶
type LRU[K comparable, V any] interface { Get(key K, fetch func() (V, error)) (V, error) SetHas(key K, value V) bool Del(key K) bool Stop() }
func NewExpirationLRU ¶
func NewExpirationLRU[K comparable, V any](size int, successTTL, failedTTL time.Duration, target Target, onEvict EvictCallback[K, V]) LRU[K, V]
func NewSlotLRU ¶
type LayLRU ¶
type LayLRU[K comparable, V any] struct { // contains filtered or unexported fields }
func NewLayLRU ¶
func NewLayLRU[K comparable, V any](size int, successTTL, failedTTL time.Duration, target Target, onEvict EvictCallback[K, V]) *LayLRU[K, V]
Click to show internal directories.
Click to hide internal directories.