Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCacheableType error = errors.New("cacheable should be of type lfuCache") ErrValueType error = errors.New("cached value type is strange") )
View Source
var (
ErrKeyNotExists error = errors.New("key doesnt not exists")
)
Functions ¶
This section is empty.
Types ¶
type MemoryClient ¶
type MemoryClient[T Cacheable] struct { LogEntry *log.Entry Prefix string // contains filtered or unexported fields }
func NewMemoryClient ¶
func (*MemoryClient[T]) Cache ¶
func (mc *MemoryClient[T]) Cache(cacheable Cacheable) error
func (*MemoryClient[T]) GetCachable ¶
func (mc *MemoryClient[T]) GetCachable(cacheable Cacheable) error
type RedisClient ¶
type RedisClient struct { LogEntry *log.Entry Prefix string Client *redis.Client Expiration time.Duration }
func NewRedisClient ¶
func (*RedisClient) Cache ¶
func (rc *RedisClient) Cache(cacheable Cacheable) error
func (*RedisClient) GetCachable ¶
func (rc *RedisClient) GetCachable(cacheable Cacheable) error
Click to show internal directories.
Click to hide internal directories.