Documentation ¶
Overview ¶
Package redistool for process with redis
Index ¶
- Constants
- Variables
- func ConvertObjToInterfaceMap(obj interface{}) (map[string]interface{}, error)
- func ConvertObjToStringMap(obj interface{}) (map[string]string, error)
- func ConvertRedisListToSlice(redisL []string, sliceObj interface{}) error
- func ConvertSliceToRedisList(sliceObj interface{}) ([]string, error)
- func ConvertStringMapToObj(hashV map[string]string, objP interface{}) error
- func ErrKeyNotExist(key string) error
- func ErrTimeOut(key string) error
- func ErrUnknown(key string) error
- func IsKeyNotExist(err error) bool
- func IsTimeOut(err error) bool
- type ErrorType
- type GlobalLock
- type GlobalLockState
- type RedisCmd
- type RedisCommandData
- type RedisContainerType
- type RedisMgr
- func (rm *RedisMgr) ClusterScan(masterNodeCmdable redis.Cmdable, cursor uint64, match string, count int64) ([]string, uint64, error)
- func (rm *RedisMgr) DBSize() (int64, error)
- func (rm *RedisMgr) DelKey(key string) (int64, error)
- func (rm *RedisMgr) Evalsha(args []interface{}) (interface{}, error)
- func (rm *RedisMgr) Exists(key string) (int64, error)
- func (rm *RedisMgr) Expire(key string, seconds int) (bool, error)
- func (rm *RedisMgr) GetClient() *redis.Client
- func (rm *RedisMgr) GetClusterClient() *redis.ClusterClient
- func (rm *RedisMgr) HashDel(key string, fields ...string) (int, error)
- func (rm *RedisMgr) HashGetAll(key string) (map[string]string, error)
- func (rm *RedisMgr) HashMSet(key string, hashV map[string]interface{}) error
- func (rm *RedisMgr) HashSet(key string, fieldKey string, value interface{}) error
- func (rm *RedisMgr) Incr(key string) (int, error)
- func (rm *RedisMgr) ListGet(key string) ([]string, error)
- func (rm *RedisMgr) ListLPop(key string) (string, error)
- func (rm *RedisMgr) ListLPushVariable(key string, value ...string) (int, error)
- func (rm *RedisMgr) ListLen(key string) (int, error)
- func (rm *RedisMgr) ListRPush(key string, value []string) (int, error)
- func (rm *RedisMgr) ListRPushVariable(key string, value ...string) (int, error)
- func (rm *RedisMgr) ListRem(key string, v string, count int) (int, error)
- func (rm *RedisMgr) ListSet(key string, value []string) error
- func (rm *RedisMgr) ListTrim(key string, start, stop int) error
- func (rm *RedisMgr) Pipelined(fn redisPipelineFn) ([]redis.Cmder, error)
- func (rm *RedisMgr) SAdd(key string, members ...interface{}) (int64, error)
- func (rm *RedisMgr) SIsMember(key string, member interface{}) (bool, error)
- func (rm *RedisMgr) SRem(key string, members ...interface{}) (int64, error)
- func (rm *RedisMgr) Scan(cursor uint64, match string, count int64) ([]string, uint64, error)
- func (rm *RedisMgr) ScriptLoad(script []byte) (interface{}, error)
- func (rm *RedisMgr) Start() error
- func (rm *RedisMgr) Stop()
- func (rm *RedisMgr) StringGet(key string) (interface{}, error)
- func (rm *RedisMgr) StringSet(key string, value []byte) error
- func (rm *RedisMgr) StringSetNX(key string, value []byte, ttl int) error
- func (rm *RedisMgr) ZIncrBy(key, member string, increment int) (int, error)
- func (rm *RedisMgr) ZRem(key string, members ...string) (int, error)
- func (rm *RedisMgr) ZReverseRank(key string, member string) (int, error)
- func (rm *RedisMgr) ZScore(key, member string) (int, error)
- type RedisResultS
- type RedisScanResult
Constants ¶
View Source
const ( REDIS_CONTAINER_STR = iota REDIS_CONTAINER_LIST REDIS_CONTAINER_SET REDIS_CONTAINER_HASH )
Variables ¶
View Source
var (
TimeType = reflect.TypeOf(_TimeDefault)
)
Functions ¶
func ConvertObjToStringMap ¶
func ConvertRedisListToSlice ¶
func ConvertSliceToRedisList ¶
func ConvertStringMapToObj ¶
func ErrKeyNotExist ¶
func ErrTimeOut ¶
func ErrUnknown ¶
func IsKeyNotExist ¶
Types ¶
type GlobalLock ¶
type GlobalLock struct {
// contains filtered or unexported fields
}
func NewGlobalLock ¶
func (*GlobalLock) Release ¶
func (gl *GlobalLock) Release()
func (*GlobalLock) Result ¶
func (gl *GlobalLock) Result() (bool, error)
func (*GlobalLock) StateChan ¶
func (gl *GlobalLock) StateChan() <-chan GlobalLockState
type GlobalLockState ¶
type GlobalLockState int
const ( GlobalLockStatePreempting GlobalLockState = iota GloblaLockStateHold GlobalLockStateExpired GlobalLockStateFailure )
type RedisCmd ¶
type RedisCmd int
命令类型
const ( REDIS_GET RedisCmd = iota REDIS_SET REDIS_SETNX REDIS_DEL REDIS_HGETALL // 得到完整的map数据 REDIS_HMGET REDIS_HSET REDIS_HMSET REDIS_HDEL // 删除hash对象中的多个field REDIS_LGET // 得到完整的list数据 REDIS_LSET // list的整体更新,把原有的key删除,重新设置 REDIS_LRPUSH REDIS_LLPUSH REDIS_LREM // 移除列表元素 REDIS_LTRIM // 保留列表指定区间的元素 REDIS_LLEN // 获取列表长度 REDIS_LPOP // 移出并获取第一个元素 REDIS_SGET // set的整体获取 REDIS_SSET // set的整体更新,把原有的key删除,重新设置 REDIS_SISMEMBER // 判断是否再set中 REDIS_SADD // set add REDIS_SREM // set remove REDIS_PIPELINE REDIS_CLUSTERSLOTS REDIS_EXISTS // 判断key是否存在 REDIS_SCRIPT_LOAD REDIS_EVAlSHA REDIS_INCR REDIS_ZINCRBY // 有序集合中对指定成员的分数加上增量 increment REDIS_ZSCORE // 返回有序集中,成员的分数值 REDIS_ZREM // 移除有序集中的一个或多个成员 REDIS_EXPIRE // 设置Key生存时间 REDIS_ZRRANK // 返回倒序索引 REDIS_SCAN // key扫描 REDIS_CLUSTERSCAN // cluster scan REDIS_DBSIZE // key的数量 )
命令字
type RedisCommandData ¶
type RedisCommandData struct {
// contains filtered or unexported fields
}
type RedisContainerType ¶
type RedisContainerType int
type RedisMgr ¶
type RedisMgr struct {
// contains filtered or unexported fields
}
func NewRedisMgr ¶
func (*RedisMgr) ClusterScan ¶
func (*RedisMgr) GetClusterClient ¶
func (rm *RedisMgr) GetClusterClient() *redis.ClusterClient
func (*RedisMgr) ListLPushVariable ¶
func (*RedisMgr) ListRPushVariable ¶
func (*RedisMgr) ScriptLoad ¶
func (*RedisMgr) StringSetNX ¶
func (*RedisMgr) ZReverseRank ¶
type RedisScanResult ¶
type RedisScanResult struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.