Documentation ¶
Index ¶
- func Delete(pool *redis.Pool, key string) error
- func FromRedis(reply, value interface{}, bad error) (err error)
- func Get(pool *redis.Pool, key string) (interface{}, error)
- func GetAll(pool *redis.Pool) (interface{}, error)
- func GetPoolForService(a ...string) *redis.Pool
- func Set(pool *redis.Pool, key string, value interface{}) error
- func SetWithExpire(pool *redis.Pool, key string, value interface{}, expire int64) error
- func ToRedis(value interface{}) interface{}
- type RedisClient
- func (r *RedisClient) Credentials() string
- func (r *RedisClient) Delete(key string) error
- func (r *RedisClient) Do(cmd string, args ...interface{}) (interface{}, error)
- func (r *RedisClient) Get(key string, value interface{}) error
- func (r *RedisClient) GetAllKeys() ([]string, error)
- func (r *RedisClient) GetKeys(matching ...string) ([]string, error)
- func (r *RedisClient) GetKeysWithPrefix(matching ...string) ([]string, error)
- func (r *RedisClient) HDel(hash string, fields ...string) error
- func (r *RedisClient) HGet(hash, field string, value interface{}) error
- func (r *RedisClient) HKeys(hash string) ([]string, error)
- func (r *RedisClient) HSet(hash, field string, value interface{}) (bool, error)
- func (r *RedisClient) HVals(hash string, save func([]uint8) error) error
- func (r *RedisClient) Info() (string, error)
- func (r *RedisClient) MGet(keys ...string) ([]interface{}, error)
- func (r *RedisClient) Set(key string, value interface{}) error
- func (r *RedisClient) SetWithExpire(key string, value interface{}, expire int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPoolForService ¶
GetPoolForService creates a Redigo Pool to connect to Redis service given
the bound service name.
func SetWithExpire ¶
SetWithExpire gets a key to the value with an expiration period
Types ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
RedisClient is the redis client
func NewRedisClient ¶
func NewRedisClient(name ...string) *RedisClient
NewRedisClient returns a redis client
func (*RedisClient) Credentials ¶
func (r *RedisClient) Credentials() string
func (*RedisClient) Delete ¶
func (r *RedisClient) Delete(key string) error
Delete deletes the key and its value
func (*RedisClient) Do ¶
func (r *RedisClient) Do(cmd string, args ...interface{}) (interface{}, error)
Do is a generic redis command function
func (*RedisClient) Get ¶
func (r *RedisClient) Get(key string, value interface{}) error
Get returns the value for key
func (*RedisClient) GetAllKeys ¶
func (r *RedisClient) GetAllKeys() ([]string, error)
GetAllKeys returns all keys
func (*RedisClient) GetKeys ¶
func (r *RedisClient) GetKeys(matching ...string) ([]string, error)
GetKeys gets the keys matching the given regexps (if any)
func (*RedisClient) GetKeysWithPrefix ¶
func (r *RedisClient) GetKeysWithPrefix(matching ...string) ([]string, error)
GetKeysWithPrefix gets the keys matching the given prefixes
func (*RedisClient) HDel ¶
func (r *RedisClient) HDel(hash string, fields ...string) error
HDel deletes the key(s) of a hash
func (*RedisClient) HGet ¶
func (r *RedisClient) HGet(hash, field string, value interface{}) error
HGet gets a hash value
func (*RedisClient) HKeys ¶
func (r *RedisClient) HKeys(hash string) ([]string, error)
HKeys gets the keys of a hash
func (*RedisClient) HSet ¶
func (r *RedisClient) HSet(hash, field string, value interface{}) (bool, error)
HSet sets a hash value returns true if new value
func (*RedisClient) HVals ¶
func (r *RedisClient) HVals(hash string, save func([]uint8) error) error
HVals gets all values of a hash
func (*RedisClient) Info ¶
func (r *RedisClient) Info() (string, error)
Info returns server information
func (*RedisClient) MGet ¶
func (r *RedisClient) MGet(keys ...string) ([]interface{}, error)
MGet gets the values for the given keys
func (*RedisClient) Set ¶
func (r *RedisClient) Set(key string, value interface{}) error
Set applies the value to key
func (*RedisClient) SetWithExpire ¶
func (r *RedisClient) SetWithExpire(key string, value interface{}, expire int64) error
SetWithExpire applies the value to key with an expiration