Documentation
¶
Index ¶
- Variables
- type Redis
- func (c *Redis) Close() error
- func (c *Redis) Decrement(ctx context.Context, key string, value int64) (int64, error)
- func (c *Redis) Delete(ctx context.Context, keys ...string) (int64, error)
- func (c *Redis) Exists(ctx context.Context, keys ...string) (bool, error)
- func (c *Redis) Expire(ctx context.Context, key string, expiration time.Duration) error
- func (c *Redis) Get(ctx context.Context, key string, value interface{}) error
- func (c *Redis) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (c *Redis) HSet(ctx context.Context, key string, value map[string]interface{}) error
- func (c *Redis) Increment(ctx context.Context, key string, value int64) (int64, error)
- func (c *Redis) Keys(ctx context.Context, pattern string) ([]string, error)
- func (c *Redis) Ping(ctx context.Context) error
- func (c *Redis) Put(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (c *Redis) TTL(ctx context.Context, key string) (time.Duration, error)
- type RedisConfig
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNil . ErrNil = errors.New("cache: value doesnt exists") // ErrCache . ErrCache = errors.New("cache error") )
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
Client *redis.Client
}
type Service ¶
type Service interface { Get(ctx context.Context, key string, value interface{}) error Put(ctx context.Context, key string, value interface{}, expiration time.Duration) error HGetAll(ctx context.Context, key string) (map[string]string, error) HSet(ctx context.Context, key string, value map[string]interface{}) error Expire(ctx context.Context, key string, expiration time.Duration) error Delete(ctx context.Context, keys ...string) (int64, error) Exists(ctx context.Context, keys ...string) (bool, error) Increment(ctx context.Context, key string, value int64) (int64, error) Decrement(ctx context.Context, key string, value int64) (int64, error) Keys(ctx context.Context, pattern string) ([]string, error) TTL(ctx context.Context, key string) (time.Duration, error) Ping(ctx context.Context) error Close() error }
Click to show internal directories.
Click to hide internal directories.