Documentation ¶
Index ¶
- Variables
- func CheckBitOP(t *testing.T, newredis RedisFactory)
- func CheckGET(t *testing.T, newredis RedisFactory)
- func CheckGETBIT(t *testing.T, newredis RedisFactory)
- func CheckGetBitSetBit(t *testing.T, newredis RedisFactory)
- func CheckLINDEX(t *testing.T, newredis RedisFactory)
- func CheckLock(t *testing.T, newRedis RedisFactory)
- func CheckMGET(t *testing.T, newredis RedisFactory)
- func CheckSCARD(t *testing.T, newredis RedisFactory)
- func CheckSMEMBERS(t *testing.T, newredis RedisFactory)
- func IsBody(s []interface{}, y interface{}) bool
- type RedisCache
- func (c RedisCache) APPEND(key string, value string, expires time.Duration) error
- func (c RedisCache) BITCOUNT(key string, start, end int) (int64, error)
- func (c RedisCache) BITOP(opt string, key1, key2 string) (string, error)
- func (c RedisCache) CheckRedis() error
- func (c RedisCache) DECR(key string, expires time.Duration) error
- func (c RedisCache) DECRBY(key string, value int, expires time.Duration) error
- func (c RedisCache) Del(key string) error
- func (c RedisCache) Exists(key string) (bool, error)
- func (c RedisCache) FlushALL() error
- func (c RedisCache) FlushDB() error
- func (c RedisCache) GETBIT(key string, offset int) (int64, error)
- func (c RedisCache) GetJSON(key string, ptrValue interface{}) error
- func (c RedisCache) HDEL(key, field string) error
- func (c RedisCache) HGET(key, field string) (string, error)
- func (c RedisCache) HGETMAP(key string, fields ...string) (map[string]string, error)
- func (c RedisCache) HKEYS(key string) ([]string, error)
- func (c RedisCache) HLEN(key string) (int64, error)
- func (c RedisCache) HMDEL(key string, fields ...string) error
- func (c RedisCache) HSET(key, field, value string, expires time.Duration) error
- func (c RedisCache) HSETMAP(key string, args map[string]string, expires time.Duration) error
- func (c RedisCache) INCR(key string, expires time.Duration) error
- func (c RedisCache) INCRBY(key string, value int, expires time.Duration) error
- func (c RedisCache) INCRBYFLOAT(key string, value float64, expires time.Duration) error
- func (c RedisCache) Keys() ([]string, error)
- func (c RedisCache) LINDEX(key string, index int, result interface{}) error
- func (c RedisCache) LINSERT(key, direction string, pivot, value interface{}) error
- func (c RedisCache) LLEN(key string) (int64, error)
- func (c RedisCache) LLREM(key string, count, value int) error
- func (c RedisCache) LPOP(key string, result interface{}) error
- func (c RedisCache) LPUSH(key string, expires time.Duration, values ...interface{}) error
- func (c RedisCache) LRANGE(key string, start, stop int) ([]interface{}, error)
- func (c RedisCache) LRREM(key string, count, value int) error
- func (c RedisCache) LSET(key string, index int, value interface{}) error
- func (c RedisCache) LTRIM(key string, start, stop int) error
- func (c RedisCache) Life(key string) (int64, error)
- func (c RedisCache) Lock(key string, expires time.Duration) (ok bool, err error)
- func (c RedisCache) MDEL(keys ...string) error
- func (c RedisCache) MGetJSON(keys ...string) (map[string]interface{}, error)
- func (c RedisCache) MSetJSON(args map[string]interface{}, expires time.Duration) error
- func (c RedisCache) RPOP(key string, result interface{}) error
- func (c RedisCache) RPOPLPUSH(key1, key2 string) error
- func (c RedisCache) RPUSH(key string, expires time.Duration, values ...interface{}) error
- func (c RedisCache) SADD(key string, expires time.Duration, args ...interface{}) error
- func (c RedisCache) SCARD(key string) (int64, error)
- func (c RedisCache) SETBIT(key string, offset, value int, expires time.Duration) error
- func (c RedisCache) SISMEMBER(key string, value interface{}) (bool, error)
- func (c RedisCache) SMEMBERS(key string) ([]interface{}, error)
- func (c RedisCache) SREM(key string, args ...interface{}) error
- func (c RedisCache) STRLEN(key string) (int64, error)
- func (c RedisCache) SetJSON(key string, value interface{}, expires time.Duration) error
- func (c RedisCache) SetLife(key string, expires time.Duration) error
- func (c RedisCache) Type(key string) (string, error)
- func (c RedisCache) Unlock(key string) error
- type RedisFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheMiss = errors.New("redis_full: key not found.")
Functions ¶
func CheckBitOP ¶
func CheckBitOP(t *testing.T, newredis RedisFactory)
func CheckGET ¶
func CheckGET(t *testing.T, newredis RedisFactory)
func CheckGETBIT ¶
func CheckGETBIT(t *testing.T, newredis RedisFactory)
func CheckGetBitSetBit ¶
func CheckGetBitSetBit(t *testing.T, newredis RedisFactory)
func CheckLINDEX ¶
func CheckLINDEX(t *testing.T, newredis RedisFactory)
func CheckMGET ¶
func CheckMGET(t *testing.T, newredis RedisFactory)
func CheckSCARD ¶
func CheckSCARD(t *testing.T, newredis RedisFactory)
func CheckSMEMBERS ¶
func CheckSMEMBERS(t *testing.T, newredis RedisFactory)
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
Wraps the Redis client to meet the Cache interface.
func NewRedisCache ¶
func NewRedisCache(host, password string, database, MaxIdle, MaxActive int, IdleTimeout, defaultExpiration time.Duration) RedisCache
until redigo supports sharding/clustering, only one host will be in hostList
func (RedisCache) BITCOUNT ¶
func (c RedisCache) BITCOUNT(key string, start, end int) (int64, error)
func (RedisCache) CheckRedis ¶
func (c RedisCache) CheckRedis() error
func (RedisCache) Del ¶
func (c RedisCache) Del(key string) error
func (RedisCache) FlushALL ¶
func (c RedisCache) FlushALL() error
func (RedisCache) FlushDB ¶
func (c RedisCache) FlushDB() error
func (RedisCache) GetJSON ¶
func (c RedisCache) GetJSON(key string, ptrValue interface{}) error
func (RedisCache) HDEL ¶
func (c RedisCache) HDEL(key, field string) error
func (RedisCache) HSET ¶
func (c RedisCache) HSET(key, field, value string, expires time.Duration) error
func (RedisCache) INCRBYFLOAT ¶
func (RedisCache) Keys ¶
func (c RedisCache) Keys() ([]string, error)
func (RedisCache) LINDEX ¶
func (c RedisCache) LINDEX(key string, index int, result interface{}) error
func (RedisCache) LINSERT ¶
func (c RedisCache) LINSERT(key, direction string, pivot, value interface{}) error
func (RedisCache) LLREM ¶
func (c RedisCache) LLREM(key string, count, value int) error
delete from left
func (RedisCache) LPOP ¶
func (c RedisCache) LPOP(key string, result interface{}) error
func (RedisCache) LPUSH ¶
func (c RedisCache) LPUSH(key string, expires time.Duration, values ...interface{}) error
func (RedisCache) LRANGE ¶
func (c RedisCache) LRANGE(key string, start, stop int) ([]interface{}, error)
func (RedisCache) LRREM ¶
func (c RedisCache) LRREM(key string, count, value int) error
delete from right
func (RedisCache) MDEL ¶
func (c RedisCache) MDEL(keys ...string) error
func (RedisCache) MGetJSON ¶
func (c RedisCache) MGetJSON(keys ...string) (map[string]interface{}, error)
func (RedisCache) MSetJSON ¶
func (c RedisCache) MSetJSON(args map[string]interface{}, expires time.Duration) error
func (RedisCache) RPOP ¶
func (c RedisCache) RPOP(key string, result interface{}) error
func (RedisCache) RPOPLPUSH ¶
func (c RedisCache) RPOPLPUSH(key1, key2 string) error
func (RedisCache) RPUSH ¶
func (c RedisCache) RPUSH(key string, expires time.Duration, values ...interface{}) error
func (RedisCache) SADD ¶
func (c RedisCache) SADD(key string, expires time.Duration, args ...interface{}) error
func (RedisCache) SISMEMBER ¶
func (c RedisCache) SISMEMBER(key string, value interface{}) (bool, error)
func (RedisCache) SMEMBERS ¶
func (c RedisCache) SMEMBERS(key string) ([]interface{}, error)
func (RedisCache) SREM ¶
func (c RedisCache) SREM(key string, args ...interface{}) error
func (RedisCache) SetJSON ¶
func (c RedisCache) SetJSON(key string, value interface{}, expires time.Duration) error
func (RedisCache) SetLife ¶
func (c RedisCache) SetLife(key string, expires time.Duration) error
设置 key 的剩余生存时间
func (RedisCache) Unlock ¶
func (c RedisCache) Unlock(key string) error
type RedisFactory ¶
type RedisFactory func(*testing.T, time.Duration) RedisCache
Click to show internal directories.
Click to hide internal directories.