Documentation ¶
Index ¶
- type Cleanable
- type EnhanceCache
- func (ec *EnhanceCache[K, V]) Clear()
- func (ec *EnhanceCache[K, V]) DecrInt(key string, value any) (current V)
- func (ec *EnhanceCache[K, V]) Delete(key string)
- func (ec *EnhanceCache[K, V]) Get(key string) (v V, exist bool)
- func (ec *EnhanceCache[K, V]) IncrInt(key string, value interface{}) (current V)
- func (ec *EnhanceCache[K, V]) LoadOrStore(key string, value V) (V, bool)
- func (ec *EnhanceCache[K, V]) Set(key string, value V)
- func (ec *EnhanceCache[K, V]) SetWithEviction(evictionFunc func(key string, value V))
- func (ec *EnhanceCache[K, V]) SetWithExpiration(key string, value V, expiration time.Duration)
- func (ec *EnhanceCache[K, V]) Size() int
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnhanceCache ¶
func NewCacheWithEviction ¶
func (*EnhanceCache[K, V]) Clear ¶
func (ec *EnhanceCache[K, V]) Clear()
func (*EnhanceCache[K, V]) DecrInt ¶
func (ec *EnhanceCache[K, V]) DecrInt(key string, value any) (current V)
func (*EnhanceCache[K, V]) Delete ¶
func (ec *EnhanceCache[K, V]) Delete(key string)
func (*EnhanceCache[K, V]) Get ¶
func (ec *EnhanceCache[K, V]) Get(key string) (v V, exist bool)
func (*EnhanceCache[K, V]) IncrInt ¶
func (ec *EnhanceCache[K, V]) IncrInt(key string, value interface{}) (current V)
IncrInt increases the int value stored under the given key by n, create new key if key does not exist. Only allow increment *int64、*int32, can multiply a float number by 100 and turn it into an integer to use it.
func (*EnhanceCache[K, V]) LoadOrStore ¶
func (ec *EnhanceCache[K, V]) LoadOrStore(key string, value V) (V, bool)
func (*EnhanceCache[K, V]) Set ¶
func (ec *EnhanceCache[K, V]) Set(key string, value V)
func (*EnhanceCache[K, V]) SetWithEviction ¶
func (ec *EnhanceCache[K, V]) SetWithEviction(evictionFunc func(key string, value V))
func (*EnhanceCache[K, V]) SetWithExpiration ¶
func (ec *EnhanceCache[K, V]) SetWithExpiration(key string, value V, expiration time.Duration)
func (*EnhanceCache[K, V]) Size ¶
func (ec *EnhanceCache[K, V]) Size() int
Click to show internal directories.
Click to hide internal directories.