Versions in this module Expand all Collapse all v1 v1.0.0 Nov 30, 2021 Changes in this version + const NoneDuration + var ErrKeyNotFound = errors.New("key not found") + var ErrTypeNotOk = errors.New("val type not ok") + func NewMemoryCache(params ...interface{}) (interface{}, error) + func NewRedisCache(params ...interface{}) (interface{}, error) + type MemoryCache struct + func (m *MemoryCache) Calc(ctx context.Context, key string, step int64) (int64, error) + func (m *MemoryCache) Decrement(ctx context.Context, key string) (int64, error) + func (m *MemoryCache) Del(ctx context.Context, key string) error + func (m *MemoryCache) DelMany(ctx context.Context, keys []string) error + func (m *MemoryCache) Get(ctx context.Context, key string) (string, error) + func (m *MemoryCache) GetMany(ctx context.Context, keys []string) (map[string]string, error) + func (m *MemoryCache) GetObj(ctx context.Context, key string, obj interface{}) error + func (m *MemoryCache) GetTTL(ctx context.Context, key string) (time.Duration, error) + func (m *MemoryCache) Increment(ctx context.Context, key string) (int64, error) + func (m *MemoryCache) Remember(ctx context.Context, key string, timeout time.Duration, ...) error + func (m *MemoryCache) Set(ctx context.Context, key string, val string, timeout time.Duration) error + func (m *MemoryCache) SetForever(ctx context.Context, key string, val string) error + func (m *MemoryCache) SetForeverObj(ctx context.Context, key string, val interface{}) error + func (m *MemoryCache) SetMany(ctx context.Context, data map[string]string, timeout time.Duration) error + func (m *MemoryCache) SetObj(ctx context.Context, key string, val interface{}, timeout time.Duration) error + func (m *MemoryCache) SetTTL(ctx context.Context, key string, timeout time.Duration) error + type MemoryData struct + type RedisCache struct + func (r *RedisCache) Calc(ctx context.Context, key string, step int64) (int64, error) + func (r *RedisCache) Decrement(ctx context.Context, key string) (int64, error) + func (r *RedisCache) Del(ctx context.Context, key string) error + func (r *RedisCache) DelMany(ctx context.Context, keys []string) error + func (r *RedisCache) Get(ctx context.Context, key string) (string, error) + func (r *RedisCache) GetMany(ctx context.Context, keys []string) (map[string]string, error) + func (r *RedisCache) GetObj(ctx context.Context, key string, model interface{}) error + func (r *RedisCache) GetTTL(ctx context.Context, key string) (time.Duration, error) + func (r *RedisCache) Increment(ctx context.Context, key string) (int64, error) + func (r *RedisCache) Remember(ctx context.Context, key string, timeout time.Duration, ...) error + func (r *RedisCache) Set(ctx context.Context, key string, val string, timeout time.Duration) error + func (r *RedisCache) SetForever(ctx context.Context, key string, val string) error + func (r *RedisCache) SetForeverObj(ctx context.Context, key string, val interface{}) error + func (r *RedisCache) SetMany(ctx context.Context, data map[string]string, timeout time.Duration) error + func (r *RedisCache) SetObj(ctx context.Context, key string, val interface{}, timeout time.Duration) error + func (r *RedisCache) SetTTL(ctx context.Context, key string, timeout time.Duration) error