Documentation ¶
Index ¶
- type EvictCallback
- type ExpirationLRU
- func (x *ExpirationLRU[K, V]) Del(key K) bool
- func (x *ExpirationLRU[K, V]) Get(key K, fetch func() (V, error)) (V, error)
- func (x *ExpirationLRU[K, V]) GetBatch(keys []K, fetch func(keys []K) (map[K]V, error)) (map[K]V, error)
- func (x *ExpirationLRU[K, V]) Set(key K, value V)
- func (x *ExpirationLRU[K, V]) SetHas(key K, value V) bool
- func (x *ExpirationLRU[K, V]) Stop()
- type LRU
- type LayLRU
- func (x *LayLRU[K, V]) Del(key K) bool
- func (x *LayLRU[K, V]) Get(key K, fetch func() (V, error)) (V, error)
- func (x *LayLRU[K, V]) GetBatch(keys []K, fetch func(keys []K) (map[K]V, error)) (map[K]V, error)
- func (x *LayLRU[K, V]) Set(key K, value V)
- func (x *LayLRU[K, V]) SetHas(key K, value V) bool
- func (x *LayLRU[K, V]) Stop()
- type Target
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]) GetBatch ¶ added in v3.8.1
func (x *ExpirationLRU[K, V]) GetBatch(keys []K, fetch func(keys []K) (map[K]V, error)) (map[K]V, error)
func (*ExpirationLRU[K, V]) Set ¶ added in v3.8.1
func (x *ExpirationLRU[K, V]) Set(key K, value V)
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) Set(key K, value V) SetHas(key K, value V) bool GetBatch(keys []K, fetch func(keys []K) (map[K]V, error)) (map[K]V, error) 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.