Documentation
¶
Index ¶
- func CacheHashKeyString(key string) uint32
- type Cache
- type CacheConfig
- type LRUCache
- type RedisCache
- func (cache *RedisCache[V]) Add(key string, value V) error
- func (cache *RedisCache[V]) AddWithLifetime(key string, value V, lifetime time.Duration) error
- func (cache *RedisCache[V]) Get(key string, value *V) bool
- func (cache *RedisCache[V]) GetName() string
- func (cache *RedisCache[V]) Remove(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheHashKeyString ¶
Types ¶
type Cache ¶
type Cache[V any] interface { GetName() string Add(key string, value V) error AddWithLifetime(key string, value V, lifetime time.Duration) error Get(key string, value *V) bool Remove(key string) }
func NewCache ¶
func NewCache[V any](conf *CacheConfig) Cache[V]
type CacheConfig ¶
type LRUCache ¶
type LRUCache[V any] struct { // contains filtered or unexported fields }
func (*LRUCache[V]) AddWithLifetime ¶
type RedisCache ¶
type RedisCache[V any] struct { // contains filtered or unexported fields }
func (*RedisCache[V]) Add ¶
func (cache *RedisCache[V]) Add(key string, value V) error
func (*RedisCache[V]) AddWithLifetime ¶
func (cache *RedisCache[V]) AddWithLifetime(key string, value V, lifetime time.Duration) error
func (*RedisCache[V]) Get ¶
func (cache *RedisCache[V]) Get(key string, value *V) bool
func (*RedisCache[V]) GetName ¶
func (cache *RedisCache[V]) GetName() string
func (*RedisCache[V]) Remove ¶
func (cache *RedisCache[V]) Remove(key string)
Click to show internal directories.
Click to hide internal directories.