Documentation ¶
Index ¶
- func WithCapacity[K comparable, V any](capacity uint) func(*lru[K, V])
- func WithExpireTimeout[K comparable, V any](t time.Duration) func(*lru[K, V])
- func WithOnRemove[K comparable, V any](f func(K, V)) func(*lru[K, V])
- type AddOption
- type Option
- type ReverseSyncLru
- func (l *ReverseSyncLru[K, V]) Add(key K, value V, opts ...AddOption[K, V])
- func (l *ReverseSyncLru[K, V]) ClearExpired()
- func (l *ReverseSyncLru[K, V]) Delete(key K)
- func (l *ReverseSyncLru[K, V]) LastPopValue() (v V, _ bool)
- func (l *ReverseSyncLru[K, V]) Load(key K) (v V, ok bool)
- func (l *ReverseSyncLru[K, V]) LoadExpireTime(key K) (v V, expireTime time.Time, ok bool)
- func (l *ReverseSyncLru[K, V]) LoadRefreshExpire(key K) (v V, ok bool)
- func (l *ReverseSyncLru[K, V]) Range(ranger func(K, V))
- func (l *ReverseSyncLru[K, V]) ReverseLoad(v V) (k K, ok bool)
- func (l *ReverseSyncLru[K, V]) ValueExist(key V) bool
- type SyncLru
- func (l *SyncLru[K, V]) Add(key K, value V, opts ...AddOption[K, V])
- func (l *SyncLru[K, V]) Delete(key K)
- func (l *SyncLru[K, V]) Load(key K) (v V, ok bool)
- func (l *SyncLru[K, V]) LoadExpireTime(key K) (v V, expireTime time.Time, ok bool)
- func (l *SyncLru[K, V]) LoadRefreshExpire(key K) (v V, ok bool)
- func (l *SyncLru[K, V]) Range(ranger func(K, V))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCapacity ¶
func WithCapacity[K comparable, V any](capacity uint) func(*lru[K, V])
func WithExpireTimeout ¶
func WithExpireTimeout[K comparable, V any](t time.Duration) func(*lru[K, V])
func WithOnRemove ¶
func WithOnRemove[K comparable, V any](f func(K, V)) func(*lru[K, V])
Types ¶
type Option ¶
type Option[K comparable, V any] func(*lru[K, V])
type ReverseSyncLru ¶ added in v0.3.6
type ReverseSyncLru[K, V comparable] struct { // contains filtered or unexported fields }
func NewSyncReverseLru ¶ added in v0.3.6
func NewSyncReverseLru[K, V comparable](options ...Option[K, V]) *ReverseSyncLru[K, V]
func (*ReverseSyncLru[K, V]) Add ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) Add(key K, value V, opts ...AddOption[K, V])
func (*ReverseSyncLru[K, V]) ClearExpired ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) ClearExpired()
func (*ReverseSyncLru[K, V]) Delete ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) Delete(key K)
func (*ReverseSyncLru[K, V]) LastPopValue ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) LastPopValue() (v V, _ bool)
func (*ReverseSyncLru[K, V]) Load ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) Load(key K) (v V, ok bool)
func (*ReverseSyncLru[K, V]) LoadExpireTime ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) LoadExpireTime(key K) (v V, expireTime time.Time, ok bool)
func (*ReverseSyncLru[K, V]) LoadRefreshExpire ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) LoadRefreshExpire(key K) (v V, ok bool)
func (*ReverseSyncLru[K, V]) Range ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) Range(ranger func(K, V))
func (*ReverseSyncLru[K, V]) ReverseLoad ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) ReverseLoad(v V) (k K, ok bool)
func (*ReverseSyncLru[K, V]) ValueExist ¶ added in v0.3.6
func (l *ReverseSyncLru[K, V]) ValueExist(key V) bool
type SyncLru ¶ added in v0.3.6
type SyncLru[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSyncLru ¶ added in v0.3.6
func NewSyncLru[K comparable, V any](options ...Option[K, V]) *SyncLru[K, V]
func (*SyncLru[K, V]) LoadExpireTime ¶ added in v0.3.6
func (*SyncLru[K, V]) LoadRefreshExpire ¶ added in v0.3.6
Click to show internal directories.
Click to hide internal directories.