Documentation ¶
Index ¶
- func Load(cfg config.Redis) (err error)
- type Cli
- type Client
- func (r *Client) Del(keys ...string) error
- func (r *Client) Exists(key string) (bool, error)
- func (r *Client) Expire(key string, exp time.Duration) error
- func (r *Client) Get(key string) ([]byte, error)
- func (r *Client) GetInt(key string) (int, error)
- func (r *Client) GetString(key string) string
- func (r *Client) Ping(ctx context.Context) error
- func (r *Client) Set(key string, value []byte, ttl time.Duration) error
- func (r *Client) SetInt(key string, value int, ttl time.Duration) error
- func (r *Client) TTL(key string) (time.Duration, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cli ¶
type Cli interface { // Get returns value from redis by `key`. Get(key string) ([]byte, error) // GetInt returns int values from redis by `key`. GetInt(key string) (int, error) // GetString returns string values from redis by `key`. GetString(key string) string // Set sets value to redis by `key` with `ttl`. Set(key string, value []byte, ttl time.Duration) error // Set sets int value to redis by `key` with `ttl`. SetInt(key string, value int, ttl time.Duration) error // Del deletes `keys` from redis. Del(keys ...string) error // TTL returns TTL by the `key`. TTL(key string) (time.Duration, error) // Expire adds expiration(`exp`) time for `key`. Expire(key string, exp time.Duration) error // Exists checks if a `key` exists. Exists(key string) (bool, error) // Ping pings the redis. Ping(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.