Documentation
¶
Index ¶
- type RedisClient
- func (rdb *RedisClient) Close() error
- func (rdb *RedisClient) Decode(encoded string, obj interface{}) error
- func (rdb *RedisClient) Del(key string) error
- func (rdb *RedisClient) DelWildcard(key string) (int, error)
- func (rdb *RedisClient) Encode(obj interface{}) (string, error)
- func (rdb *RedisClient) Expire(key string, expiration time.Duration) error
- func (rdb *RedisClient) Get(key string) (string, error)
- func (rdb *RedisClient) List(key string) ([]string, error)
- func (rdb *RedisClient) Ping() bool
- func (rdb *RedisClient) PurgeAll() (bool, error)
- func (rdb *RedisClient) Push(key string, values []string) error
- func (rdb *RedisClient) Set(key string, value string, expiration time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient struct { *redis.Client Name string }
RedisClient - Redis Client structure
func Connect ¶
func Connect(connName string, config config.Cache) *RedisClient
Connect - Connects to DB.
func (*RedisClient) Decode ¶
func (rdb *RedisClient) Decode(encoded string, obj interface{}) error
Decode - Decodes an object with msgpack.
func (*RedisClient) DelWildcard ¶
func (rdb *RedisClient) DelWildcard(key string) (int, error)
DelWildcard - Removes the matching keys based on a pattern.
func (*RedisClient) Encode ¶
func (rdb *RedisClient) Encode(obj interface{}) (string, error)
Encode - Encodes an object with msgpack.
func (*RedisClient) Expire ¶
func (rdb *RedisClient) Expire(key string, expiration time.Duration) error
Expire - Sets a TTL on a key.
func (*RedisClient) List ¶
func (rdb *RedisClient) List(key string) ([]string, error)
List - Returns the values in a list.
func (*RedisClient) PurgeAll ¶
func (rdb *RedisClient) PurgeAll() (bool, error)
PurgeAll - Purges all the existing keys on a DB.
Click to show internal directories.
Click to hide internal directories.