Documentation
¶
Index ¶
- Constants
- func Append(key string, value interface{}) (err error)
- func Close() (err error)
- func Decode(value []byte, result interface{}) (err error)
- func Decr(key string, value int) (err error)
- func DecrBy(key string, value int) (err error)
- func Delete(key string) (err error)
- func Do(ctx context.Context, args ...interface{}) *redis.Cmd
- func Encode(value interface{}) (result []byte, err error)
- func ExistsKey(key string) (iskeep bool, err error)
- func ExpireKey(key string, expire int) (err error)
- func ExpireatKey(key string, expire_unix int64) (err error)
- func Get(key string, value interface{}) (err error)
- func GetSet(key string, value interface{}, result interface{}) (err error)
- func HDel(key string, fields ...string) (err error)
- func HExists(key string, field string) (result bool, err error)
- func HGet(key string, field string, value interface{}) (err error)
- func HGetAll(key string, valuetype reflect.Type) (result []interface{}, err error)
- func HIncrBy(key string, field string, value int) (err error)
- func HIncrByFloat(key string, field string, value float32) (err error)
- func HMGet(key string, valuetype reflect.Type, fields ...string) (result []interface{}, err error)
- func HMSet(key string, value map[string]interface{}) (err error)
- func HSet(key string, field string, value interface{}) (err error)
- func HSetNX(key string, field string, value interface{}) (err error)
- func Hkeys(key string) (result []string, err error)
- func Hlen(key string) (result int, err error)
- func INCRBY(key string, amount int64) (result int64, err error)
- func Incr(key string) (err error)
- func IncrBY(key string, value int) (err error)
- func Incrbyfloat(key string, value float32) (err error)
- func Keys(pattern string) (keys []string, err error)
- func LPop(key string, value interface{}) (err error)
- func LPush(key string, values ...interface{}) (err error)
- func LPushX(key string, values ...interface{}) (err error)
- func LRange(key string, start, end int, valuetype reflect.Type) (result []interface{}, err error)
- func LRem(key string, count int, target interface{}) (err error)
- func LSet(key string, index int, value interface{}) (err error)
- func Lindex(key string, value interface{}) (err error)
- func Linsert(key string, isbefore bool, tager interface{}, value interface{}) (err error)
- func Llen(key string) (result int, err error)
- func Lock(key string, outTime int) (result bool, err error)
- func Ltrim(key string, start, stop int) (err error)
- func MGet(keys ...string) (result []string, err error)
- func MSet(keyvalues map[string]interface{}) (err error)
- func MSetNX(keyvalues map[string]interface{}) (err error)
- func PersistKey(key string) (err error)
- func PexpireatKey(key string, expire_unix int64) (err error)
- func Pexpirekey(key string, expire int) (err error)
- func Pipeline(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error)
- func PttlKey(key string) (leftexpire int64, err error)
- func RPopLPush(oldkey string, newkey string, value interface{}) (err error)
- func RPush(key string, values ...interface{}) (err error)
- func RPushX(key string, values ...interface{}) (err error)
- func RenameKye(oldkey string, newkey string) (err error)
- func RenamenxKey(oldkey string, newkey string) (err error)
- func Rpop(key string, value interface{}) (err error)
- func SAdd(key string, values ...interface{}) (err error)
- func SCard(key string) (result int64, err error)
- func SDiff(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func SDiffStore(destination string, keys ...string) (result int64, err error)
- func SInter(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func SInterStore(destination string, keys ...string) (result int64, err error)
- func SMembers(valuetype reflect.Type, key string) (result []interface{}, err error)
- func SMove(source string, destination string, member interface{}) (result bool, err error)
- func SRem(key string, members ...interface{}) (result int64, err error)
- func SUnion(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func Set(key string, value interface{}, expiration time.Duration) (err error)
- func SetNX(key string, value interface{}) (result int64, err error)
- func Sismember(key string, value interface{}) (iskeep bool, err error)
- func Spop(key string) (result string, err error)
- func Srandmember(key string) (result string, err error)
- func Sscan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error)
- func Sunionstore(destination string, keys ...string) (result int64, err error)
- func TtlKey(key string) (leftexpire int64, err error)
- func TxPipelined(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error)
- func Type(key string) (ty string, err error)
- func UnLock(key string) (err error)
- func Watch(ctx context.Context, fn func(*redis.Tx) error, keys ...string) (err error)
- func ZAdd(key string, members ...*redis.Z) (err error)
- func ZCard(key string) (result int64, err error)
- func ZCount(key string, min string, max string) (result int64, err error)
- func ZIncrBy(key string, increment float64, member string) (result float64, err error)
- func ZInterStore(destination string, store *redis.ZStore) (result int64, err error)
- func ZLexCount(key string, min string, max string) (result int64, err error)
- func ZRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error)
- func ZRangeByLex(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func ZRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func ZRank(key string, member string) (result int64, err error)
- func ZRem(key string, members ...interface{}) (result int64, err error)
- func ZRemRangeByLex(key string, min string, max string) (result int64, err error)
- func ZRemRangeByRank(key string, start int64, stop int64) (result int64, err error)
- func ZRemRangeByScore(key string, min string, max string) (result int64, err error)
- func ZRevRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error)
- func ZRevRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func ZRevRank(key string, member string) (result int64, err error)
- func ZScan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error)
- func ZScore(key string, member string) (result float64, err error)
- func ZUnionStore(dest string, store *redis.ZStore) (result int64, err error)
- type IRedis
- type IRedisSys
- type Option
- type Optionfn
- func Redis_Cluster_Addr(v []string) Optionfn
- func SetRedisStorageType(v RedisStorageType) Optionfn
- func SetRedisType(v RedisType) Optionfn
- func SetRedis_Cluster_Password(v string) Optionfn
- func SetRedis_Single_Addr(v string) Optionfn
- func SetRedis_Single_DB(v int) Optionfn
- func SetRedis_Single_Password(v string) Optionfn
- func SetRedis_Single_PoolSize(v int) Optionfn
- func SetTimeOut(v time.Duration) Optionfn
- type RMutexOption
- type RMutexOptionfn
- type Redis
- func (this *Redis) Append(key string, value interface{}) (err error)
- func (this *Redis) Close() (err error)
- func (this *Redis) Decode(value []byte, result interface{}) (err error)
- func (this *Redis) Decr(key string, value int) (err error)
- func (this *Redis) DecrBy(key string, value int) (err error)
- func (this *Redis) Delete(key string) (err error)
- func (this *Redis) Do(ctx context.Context, args ...interface{}) *redis.Cmd
- func (this *Redis) Encode(value interface{}) (result []byte, err error)
- func (this *Redis) ExistsKey(key string) (iskeep bool, err error)
- func (this *Redis) ExpireKey(key string, expire int) (err error)
- func (this *Redis) ExpireatKey(key string, expire_unix int64) (err error)
- func (this *Redis) Get(key string, value interface{}) (err error)
- func (this *Redis) GetSet(key string, value interface{}, result interface{}) (err error)
- func (this *Redis) HDel(key string, fields ...string) (err error)
- func (this *Redis) HExists(key string, field string) (result bool, err error)
- func (this *Redis) HGet(key string, field string, value interface{}) (err error)
- func (this *Redis) HGetAll(key string, valuetype reflect.Type) (result []interface{}, err error)
- func (this *Redis) HIncrBy(key string, field string, value int) (err error)
- func (this *Redis) HIncrByFloat(key string, field string, value float32) (err error)
- func (this *Redis) HMGet(key string, valuetype reflect.Type, fields ...string) (result []interface{}, err error)
- func (this *Redis) HMSet(key string, value map[string]interface{}) (err error)
- func (this *Redis) HSet(key string, field string, value interface{}) (err error)
- func (this *Redis) HSetNX(key string, field string, value interface{}) (err error)
- func (this *Redis) Hkeys(key string) (result []string, err error)
- func (this *Redis) Hlen(key string) (result int, err error)
- func (this *Redis) INCRBY(key string, amount int64) (result int64, err error)
- func (this *Redis) Incr(key string) (err error)
- func (this *Redis) IncrBY(key string, value int) (err error)
- func (this *Redis) Incrbyfloat(key string, value float32) (err error)
- func (this *Redis) Keys(pattern string) (keys []string, err error)
- func (this *Redis) LPop(key string, value interface{}) (err error)
- func (this *Redis) LPush(key string, values ...interface{}) (err error)
- func (this *Redis) LPushX(key string, values ...interface{}) (err error)
- func (this *Redis) LRange(key string, start, end int, valuetype reflect.Type) (result []interface{}, err error)
- func (this *Redis) LRem(key string, count int, target interface{}) (err error)
- func (this *Redis) LSet(key string, index int, value interface{}) (err error)
- func (this *Redis) Lindex(key string, value interface{}) (err error)
- func (this *Redis) Linsert(key string, isbefore bool, tager interface{}, value interface{}) (err error)
- func (this *Redis) Llen(key string) (result int, err error)
- func (this *Redis) Lock(key string, outTime int) (result bool, err error)
- func (this *Redis) Ltrim(key string, start, stop int) (err error)
- func (this *Redis) MGet(keys ...string) (result []string, err error)
- func (this *Redis) MSet(keyvalues map[string]interface{}) (err error)
- func (this *Redis) MSetNX(keyvalues map[string]interface{}) (err error)
- func (this *Redis) NewRedisMutex(key string, optfns ...RMutexOptionfn) (result *RedisMutex, err error)
- func (this *Redis) PersistKey(key string) (err error)
- func (this *Redis) PexpireatKey(key string, expire_unix int64) (err error)
- func (this *Redis) Pexpirekey(key string, expire int) (err error)
- func (this *Redis) Pipeline(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error)
- func (this *Redis) PttlKey(key string) (leftexpire int64, err error)
- func (this *Redis) RPopLPush(oldkey string, newkey string, value interface{}) (err error)
- func (this *Redis) RPush(key string, values ...interface{}) (err error)
- func (this *Redis) RPushX(key string, values ...interface{}) (err error)
- func (this *Redis) RenameKye(oldkey string, newkey string) (err error)
- func (this *Redis) RenamenxKey(oldkey string, newkey string) (err error)
- func (this *Redis) Rpop(key string, value interface{}) (err error)
- func (this *Redis) SAdd(key string, values ...interface{}) (err error)
- func (this *Redis) SCard(key string) (result int64, err error)
- func (this *Redis) SDiff(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func (this *Redis) SDiffStore(destination string, keys ...string) (result int64, err error)
- func (this *Redis) SInter(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func (this *Redis) SInterStore(destination string, keys ...string) (result int64, err error)
- func (this *Redis) SMembers(valuetype reflect.Type, key string) (result []interface{}, err error)
- func (this *Redis) SMove(source string, destination string, member interface{}) (result bool, err error)
- func (this *Redis) SRem(key string, members ...interface{}) (result int64, err error)
- func (this *Redis) SUnion(valuetype reflect.Type, keys ...string) (result []interface{}, err error)
- func (this *Redis) Set(key string, value interface{}, expiration time.Duration) (err error)
- func (this *Redis) SetNX(key string, value interface{}) (result int64, err error)
- func (this *Redis) Sismember(key string, value interface{}) (iskeep bool, err error)
- func (this *Redis) Spop(key string) (result string, err error)
- func (this *Redis) Srandmember(key string) (result string, err error)
- func (this *Redis) Sscan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error)
- func (this *Redis) Sunionstore(destination string, keys ...string) (result int64, err error)
- func (this *Redis) TtlKey(key string) (leftexpire int64, err error)
- func (this *Redis) TxPipelined(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error)
- func (this *Redis) Type(key string) (ty string, err error)
- func (this *Redis) UnLock(key string) (err error)
- func (this *Redis) Watch(ctx context.Context, fn func(*redis.Tx) error, keys ...string) (err error)
- func (this *Redis) ZAdd(key string, members ...*redis.Z) (err error)
- func (this *Redis) ZCard(key string) (result int64, err error)
- func (this *Redis) ZCount(key string, min string, max string) (result int64, err error)
- func (this *Redis) ZIncrBy(key string, increment float64, member string) (result float64, err error)
- func (this *Redis) ZInterStore(destination string, store *redis.ZStore) (result int64, err error)
- func (this *Redis) ZLexCount(key string, min string, max string) (result int64, err error)
- func (this *Redis) ZRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error)
- func (this *Redis) ZRangeByLex(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func (this *Redis) ZRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func (this *Redis) ZRank(key string, member string) (result int64, err error)
- func (this *Redis) ZRem(key string, members ...interface{}) (result int64, err error)
- func (this *Redis) ZRemRangeByLex(key string, min string, max string) (result int64, err error)
- func (this *Redis) ZRemRangeByRank(key string, start int64, stop int64) (result int64, err error)
- func (this *Redis) ZRemRangeByScore(key string, min string, max string) (result int64, err error)
- func (this *Redis) ZRevRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error)
- func (this *Redis) ZRevRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error)
- func (this *Redis) ZRevRank(key string, member string) (result int64, err error)
- func (this *Redis) ZScan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error)
- func (this *Redis) ZScore(key string, member string) (result float64, err error)
- func (this *Redis) ZUnionStore(dest string, store *redis.ZStore) (result int64, err error)
- type RedisMutex
- type RedisStorageType
- type RedisType
Constants ¶
View Source
const ( RedisNil = redis.Nil TxFailedErr = redis.TxFailedErr )
View Source
const ( Redis_Single = iota Redis_Cluster )
Variables ¶
This section is empty.
Functions ¶
func ExpireatKey ¶
func Incrbyfloat ¶
func PersistKey ¶
func PexpireatKey ¶
func Pexpirekey ¶
func RenamenxKey ¶
func Srandmember ¶
func TxPipelined ¶
func ZInterStore ¶
func ZRangeByLex ¶
func ZRangeByScore ¶
func ZRemRangeByLex ¶
func ZRemRangeByRank ¶
func ZRemRangeByScore ¶
func ZRevRangeByScore ¶
func ZUnionStore ¶
Types ¶
type IRedis ¶
type IRedis interface { Close() (err error) Do(ctx context.Context, args ...interface{}) *redis.Cmd Lock(key string, outTime int) (result bool, err error) UnLock(key string) (err error) Pipeline(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error) TxPipelined(ctx context.Context, fn func(pipe redis.Pipeliner) error) (err error) Watch(ctx context.Context, fn func(*redis.Tx) error, keys ...string) (err error) /*Key*/ Delete(key string) (err error) ExistsKey(key string) (iskeep bool, err error) ExpireKey(key string, expire int) (err error) ExpireatKey(key string, expire_unix int64) (err error) Pexpirekey(key string, expire int) (err error) PexpireatKey(key string, expire_unix int64) (err error) PersistKey(key string) (err error) PttlKey(key string) (leftexpire int64, err error) TtlKey(key string) (leftexpire int64, err error) RenameKye(oldkey string, newkey string) (err error) RenamenxKey(oldkey string, newkey string) (err error) Keys(pattern string) (keys []string, err error) Type(key string) (ty string, err error) /*String*/ Set(key string, value interface{}, expiration time.Duration) (err error) SetNX(key string, value interface{}) (result int64, err error) MSet(keyvalues map[string]interface{}) (err error) MSetNX(keyvalues map[string]interface{}) (err error) Incr(key string) (err error) IncrBY(key string, value int) (err error) Incrbyfloat(key string, value float32) (err error) Decr(key string, value int) (err error) DecrBy(key string, value int) (err error) Append(key string, value interface{}) (err error) Get(key string, value interface{}) (err error) GetSet(key string, value interface{}, result interface{}) (err error) MGet(keys ...string) (result []string, err error) INCRBY(key string, amount int64) (result int64, err error) /*List*/ Lindex(key string, value interface{}) (err error) Linsert(key string, isbefore bool, tager interface{}, value interface{}) (err error) Llen(key string) (result int, err error) LPop(key string, value interface{}) (err error) LPush(key string, values ...interface{}) (err error) LPushX(key string, values ...interface{}) (err error) LRange(key string, start, end int, valuetype reflect.Type) (result []interface{}, err error) LRem(key string, count int, target interface{}) (err error) LSet(key string, index int, value interface{}) (err error) Ltrim(key string, start, stop int) (err error) Rpop(key string, value interface{}) (err error) RPopLPush(oldkey string, newkey string, value interface{}) (err error) RPush(key string, values ...interface{}) (err error) RPushX(key string, values ...interface{}) (err error) /*Hash*/ HDel(key string, fields ...string) (err error) HExists(key string, field string) (result bool, err error) HGet(key string, field string, value interface{}) (err error) HGetAll(key string, valuetype reflect.Type) (result []interface{}, err error) HIncrBy(key string, field string, value int) (err error) HIncrByFloat(key string, field string, value float32) (err error) Hkeys(key string) (result []string, err error) Hlen(key string) (result int, err error) HMGet(key string, valuetype reflect.Type, fields ...string) (result []interface{}, err error) HMSet(key string, value map[string]interface{}) (err error) HSet(key string, field string, value interface{}) (err error) HSetNX(key string, field string, value interface{}) (err error) /*Set*/ SAdd(key string, values ...interface{}) (err error) SCard(key string) (result int64, err error) SDiff(valuetype reflect.Type, keys ...string) (result []interface{}, err error) SDiffStore(destination string, keys ...string) (result int64, err error) SInter(valuetype reflect.Type, keys ...string) (result []interface{}, err error) SInterStore(destination string, keys ...string) (result int64, err error) Sismember(key string, value interface{}) (iskeep bool, err error) SMembers(valuetype reflect.Type, key string) (result []interface{}, err error) SMove(source string, destination string, member interface{}) (result bool, err error) Spop(key string) (result string, err error) Srandmember(key string) (result string, err error) SRem(key string, members ...interface{}) (result int64, err error) SUnion(valuetype reflect.Type, keys ...string) (result []interface{}, err error) Sunionstore(destination string, keys ...string) (result int64, err error) Sscan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error) /*ZSet*/ ZAdd(key string, members ...*redis.Z) (err error) ZCard(key string) (result int64, err error) ZCount(key string, min string, max string) (result int64, err error) ZIncrBy(key string, increment float64, member string) (result float64, err error) ZInterStore(destination string, store *redis.ZStore) (result int64, err error) ZLexCount(key string, min string, max string) (result int64, err error) ZRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error) ZRangeByLex(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error) ZRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error) ZRank(key string, member string) (result int64, err error) ZRem(key string, members ...interface{}) (result int64, err error) ZRemRangeByLex(key string, min string, max string) (result int64, err error) ZRemRangeByRank(key string, start int64, stop int64) (result int64, err error) ZRemRangeByScore(key string, min string, max string) (result int64, err error) ZRevRange(valuetype reflect.Type, key string, start int64, stop int64) (result []interface{}, err error) ZRevRangeByScore(valuetype reflect.Type, key string, opt *redis.ZRangeBy) (result []interface{}, err error) ZRevRank(key string, member string) (result int64, err error) ZScore(key string, member string) (result float64, err error) ZUnionStore(dest string, store *redis.ZStore) (result int64, err error) ZScan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error) }
type IRedisSys ¶
type IRedisSys interface { IRedis /*Lock*/ NewRedisMutex(key string, optfns ...RMutexOptionfn) (result *RedisMutex, err error) Encode(value interface{}) (result []byte, err error) Decode(value []byte, result interface{}) (err error) }
type Optionfn ¶
type Optionfn func(*Option)
func Redis_Cluster_Addr ¶
func SetRedisStorageType ¶
func SetRedisStorageType(v RedisStorageType) Optionfn
func SetRedisType ¶
func SetRedis_Single_Addr ¶
/RedisUrl = "127.0.0.1:6379"
func SetRedis_Single_DB ¶
func SetTimeOut ¶
type RMutexOption ¶
type RMutexOption struct {
// contains filtered or unexported fields
}
type RMutexOptionfn ¶
type RMutexOptionfn func(*RMutexOption)
func SetDelay ¶
func SetDelay(v time.Duration) RMutexOptionfn
func SetExpiry ¶
func SetExpiry(v int) RMutexOptionfn
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func (*Redis) ExpireatKey ¶
func (*Redis) HIncrByFloat ¶
func (*Redis) NewRedisMutex ¶
func (this *Redis) NewRedisMutex(key string, optfns ...RMutexOptionfn) (result *RedisMutex, err error)
func (*Redis) PersistKey ¶
func (*Redis) PexpireatKey ¶
func (*Redis) RenamenxKey ¶
func (*Redis) SDiffStore ¶
func (*Redis) SInterStore ¶
func (*Redis) Sunionstore ¶
func (*Redis) TxPipelined ¶
func (*Redis) ZInterStore ¶
func (*Redis) ZRangeByLex ¶
func (*Redis) ZRangeByScore ¶
func (*Redis) ZRemRangeByLex ¶
func (*Redis) ZRemRangeByRank ¶
func (*Redis) ZRemRangeByScore ¶
func (*Redis) ZRevRangeByScore ¶
type RedisMutex ¶
type RedisMutex struct {
// contains filtered or unexported fields
}
func NewRedisMutex ¶
func NewRedisMutex(key string, opt ...RMutexOptionfn) (result *RedisMutex, err error)
Lock
func (*RedisMutex) Lock ¶
func (this *RedisMutex) Lock() (err error)
func (*RedisMutex) Unlock ¶
func (this *RedisMutex) Unlock()
type RedisStorageType ¶
type RedisStorageType int8
/redis 存储数据格式化类型
const ( JsonData RedisStorageType = iota ProtoData )
Click to show internal directories.
Click to hide internal directories.