Documentation ¶
Index ¶
- Variables
- func AddRedis(key, addr string, options redis.Options)
- func GetClient(key string) *redis.Client
- func GetEnableKafka() bool
- func GetEnableStub() bool
- func GetRedisClient(server string) *redis.Client
- func GetRedisConf() map[string]string
- func GetSelectors() map[string]*Selector
- func GetSlowThreshold() time.Duration
- func GetWarnKeySize() int
- func SetInstance(server string, client *redis.Client)
- type PipelineIns
- type RedisResult
- func (res RedisResult) Error() error
- func (res RedisResult) ToBool() (back bool, err error)
- func (res RedisResult) ToBoolSlice() (back []bool, err error)
- func (res RedisResult) ToFloat64() (back float64, err error)
- func (res RedisResult) ToInt64() (back int64, err error)
- func (res RedisResult) ToSlice() (back []interface{}, err error)
- func (res RedisResult) ToString() (back string, err error)
- func (res RedisResult) ToStringIntMap() (map[string]int64, error)
- func (res RedisResult) ToStringSlice() (back []string, err error)
- func (res RedisResult) ToStringStringMap() (map[string]string, error)
- func (res RedisResult) ToStringStructMap() (map[string]struct{}, error)
- func (res RedisResult) ToTime() (back time.Time, err error)
- func (res RedisResult) ToZSlice() ([]redis.Z, error)
- type Selector
- type Weighted
- type XesRedis
- func (this *XesRedis) Decr(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) DecrBy(keyName string, keyParams []interface{}, decrement interface{}) (back int64, err error)
- func (this *XesRedis) Del(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back int64, err error)
- func (this *XesRedis) Eval(instance string, script string, keys []string, args ...interface{}) (interface{}, error)
- func (this *XesRedis) ExecPipeLine() (ret []RedisResult, errs []error)
- func (this *XesRedis) Exists(keyName string, keyParams []interface{}) (back bool, err error)
- func (this *XesRedis) Expire(keyName string, keyParams []interface{}, value interface{}) (back bool, err error)
- func (this *XesRedis) Get(keyName string, keyParams []interface{}) (back string, err error)
- func (this *XesRedis) GetCtx() context.Context
- func (this *XesRedis) GetKey() string
- func (this *XesRedis) GetKeyName() string
- func (this *XesRedis) GetKeyParams() []interface{}
- func (this *XesRedis) GetPipeLiner() map[string]*PipelineIns
- func (this *XesRedis) GetSet(keyName string, keyParams []interface{}, value interface{}) (back string, err error)
- func (this *XesRedis) Go() *XesRedis
- func (this *XesRedis) HDel(keyName string, keyParams []interface{}, fields []interface{}) (back string, err error)
- func (this *XesRedis) HGet(keyName string, keyParams []interface{}, filed interface{}) (back string, err error)
- func (this *XesRedis) HGetAll(keyName string, keyParams []interface{}) (back map[string]string, err error)
- func (this *XesRedis) HIncrBy(keyName string, keyParams []interface{}, field interface{}, ...) (back int64, err error)
- func (this *XesRedis) HLen(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) HMGet(keyName string, keyParams []interface{}, fileds []interface{}) (back []string, err error)
- func (this *XesRedis) HMSet(keyName string, keyParams []interface{}, value map[string]interface{}) (back string, err error)
- func (this *XesRedis) HSet(keyName string, keyParams []interface{}, field interface{}, value interface{}) (back string, err error)
- func (this *XesRedis) HSetNx(keyName string, keyParams []interface{}, field interface{}, value interface{}) (back bool, err error)
- func (this *XesRedis) Hkeys(keyName string, keyParams []interface{}) (back []string, err error)
- func (this *XesRedis) Hvals(keyName string, keyParams []interface{}) (back []string, err error)
- func (this *XesRedis) Incr(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) IncrBy(keyName string, keyParams []interface{}, increment interface{}) (back int64, err error)
- func (this *XesRedis) IncrByFloat(keyName string, keyParams []interface{}, value interface{}) (back float64, err error)
- func (this *XesRedis) LLen(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) LPush(keyName string, keyParams []interface{}, value []interface{}) (back int64, err error)
- func (this *XesRedis) LRange(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back []string, err error)
- func (this *XesRedis) LRem(keyName string, keyParams []interface{}, value interface{}, count int) (back int64, err error)
- func (this *XesRedis) LTrim(keyName string, keyParams []interface{}, start, stop int) (back int64, err error)
- func (this *XesRedis) MGet(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back []string, err error)
- func (this *XesRedis) MSet(keyName string, keyParams []interface{}, value interface{}, ...) (back string, err error)
- func (this *XesRedis) OpenPipeLine()
- func (this *XesRedis) Persist(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) RPop(keyName string, keyParams []interface{}) (back string, err error)
- func (this *XesRedis) RPush(keyName string, keyParams []interface{}, value []interface{}) (back int64, err error)
- func (this *XesRedis) SAdd(keyName string, keyParams []interface{}, members []interface{}) (back int64, err error)
- func (this *XesRedis) SCard(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) SDiff(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back []string, err error)
- func (this *XesRedis) SMembers(keyName string, keyParams []interface{}) (back []string, err error)
- func (this *XesRedis) SRandMember(keyName string, keyParams []interface{}, count []interface{}) (back []string, err error)
- func (this *XesRedis) SRem(keyName string, keyParams []interface{}, member []interface{}) (back int64, err error)
- func (this *XesRedis) SUnionStore(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back int64, err error)
- func (this *XesRedis) Set(keyName string, keyParams []interface{}, value interface{}, ex int64) (back string, err error)
- func (this *XesRedis) SetCtx(ctx context.Context)
- func (this *XesRedis) SetHandler(handler redo.XesRedisHandler)
- func (this *XesRedis) SetInstanceIP(ip string)
- func (this *XesRedis) SetNX(keyName string, keyParams []interface{}, value interface{}, ex int64) (back string, err error)
- func (this *XesRedis) SetNXBool(keyName string, keyParams []interface{}, value interface{}) (back bool, err error)
- func (this *XesRedis) SetPipeLineFlag()
- func (this *XesRedis) SetPipeLiner(pip map[string]*PipelineIns)
- func (this *XesRedis) SisMember(keyName string, keyParams []interface{}, member []interface{}) (back int64, err error)
- func (this *XesRedis) String() (back string)
- func (this *XesRedis) TTL(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) ZAdd(keyName string, keyParams []interface{}, zParams []interface{}) (back int64, err error)
- func (this *XesRedis) ZCard(keyName string, keyParams []interface{}) (back int64, err error)
- func (this *XesRedis) ZCount(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back int64, err error)
- func (this *XesRedis) ZIncrBy(keyName string, keyParams []interface{}, increment interface{}, member string) (back float64, err error)
- func (this *XesRedis) ZRange(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back []string, err error)
- func (this *XesRedis) ZRangeByScore(keyName string, keyParams []interface{}, start interface{}, end interface{}, ...) (back []string, err error)
- func (this *XesRedis) ZRangeByScoreWithSocres(keyName string, keyParams []interface{}, start interface{}, end interface{}, ...) (back []redis.Z, err error)
- func (this *XesRedis) ZRangeWithScores(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back []redis.Z, err error)
- func (this *XesRedis) ZRank(keyName string, keyParams []interface{}, member string) (back int64, err error)
- func (this *XesRedis) ZRem(keyName string, keyParams []interface{}, childkeys []interface{}) (int64, error)
- func (this *XesRedis) ZRemRangeByRank(keyName string, keyParams []interface{}, start interface{}, end interface{}) (int64, error)
- func (this *XesRedis) ZRemRangeByScore(keyName string, keyParams []interface{}, min interface{}, max interface{}) (int64, error)
- func (this *XesRedis) ZRevRange(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back []string, err error)
- func (this *XesRedis) ZRevRangeByScore(keyName string, keyParams []interface{}, start interface{}, end interface{}, ...) (back []string, err error)
- func (this *XesRedis) ZRevRangeByScoreWithSocres(keyName string, keyParams []interface{}, start interface{}, end interface{}, ...) (back []redis.Z, err error)
- func (this *XesRedis) ZRevRangeWithScores(keyName string, keyParams []interface{}, start interface{}, end interface{}) (back []redis.Z, err error)
- func (this *XesRedis) ZRevRank(keyName string, keyParams []interface{}, member string) (back int64, err error)
- func (this *XesRedis) ZScore(keyName string, keyParams []interface{}, member string) (back float64, err error)
Constants ¶
This section is empty.
Variables ¶
var (
RedisConfMap map[string]string
)
Functions ¶
func GetRedisClient ¶
GetRedisClient return redis client specified by redis server host.
func GetSelectors ¶
GetSelectors returns redis clients map with Weight configuration.
func GetSlowThreshold ¶
GetSlowThreshold returns the value of slowThreshold.
func SetInstance ¶
SetInstance can set redis client into redisInstances Map.
Types ¶
type PipelineIns ¶
type PipelineIns struct {
// contains filtered or unexported fields
}
type RedisResult ¶
type RedisResult struct {
// contains filtered or unexported fields
}
func (RedisResult) Error ¶
func (res RedisResult) Error() error
func (RedisResult) ToBool ¶
func (res RedisResult) ToBool() (back bool, err error)
func (RedisResult) ToBoolSlice ¶
func (res RedisResult) ToBoolSlice() (back []bool, err error)
func (RedisResult) ToFloat64 ¶
func (res RedisResult) ToFloat64() (back float64, err error)
func (RedisResult) ToInt64 ¶
func (res RedisResult) ToInt64() (back int64, err error)
func (RedisResult) ToSlice ¶
func (res RedisResult) ToSlice() (back []interface{}, err error)
func (RedisResult) ToString ¶
func (res RedisResult) ToString() (back string, err error)
func (RedisResult) ToStringIntMap ¶
func (res RedisResult) ToStringIntMap() (map[string]int64, error)
ToStringIntMap will force the result into map[string]int64 type.
func (RedisResult) ToStringSlice ¶
func (res RedisResult) ToStringSlice() (back []string, err error)
func (RedisResult) ToStringStringMap ¶
func (res RedisResult) ToStringStringMap() (map[string]string, error)
ToStringStringMap will force the result into map[string]string type.
func (RedisResult) ToStringStructMap ¶
func (res RedisResult) ToStringStructMap() (map[string]struct{}, error)
ToStringStructMap will force the result into map[string]struct{} type.
type XesRedis ¶
type XesRedis struct {
// contains filtered or unexported fields
}
func (*XesRedis) Del ¶
func (this *XesRedis) Del(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back int64, err error)
NOTE: support multi del Del("key1",nil,"key2",nil,"key3",nil)
func (*XesRedis) Eval ¶
func (this *XesRedis) Eval(instance string, script string, keys []string, args ...interface{}) (interface{}, error)
exec redis lua
func (*XesRedis) ExecPipeLine ¶
func (this *XesRedis) ExecPipeLine() (ret []RedisResult, errs []error)
Executing commands in the PipeLine.
func (*XesRedis) GetKeyName ¶
GetKeyName returns redis client's keyName.
func (*XesRedis) GetKeyParams ¶
func (this *XesRedis) GetKeyParams() []interface{}
GetKeyParams returns redis client's key params.
func (*XesRedis) GetPipeLiner ¶
func (this *XesRedis) GetPipeLiner() map[string]*PipelineIns
GetPipeLiner returns redis client's pipeLiners.
func (*XesRedis) IncrByFloat ¶
func (*XesRedis) MGet ¶
func (this *XesRedis) MGet(keyName string, keyParams []interface{}, otherKeys ...interface{}) (back []string, err error)
NOTE: MGet("key1_%v",[]interface{}{100},"key2",nil,"key3",nil)
func (*XesRedis) MSet ¶
func (this *XesRedis) MSet(keyName string, keyParams []interface{}, value interface{}, otherKeys ...interface{}) (back string, err error)
NOTE: MSet("key1_%v",[]interface{}{100},"value1","key2",nil,"value2","key3",nil,"value3")
func (*XesRedis) OpenPipeLine ¶
func (this *XesRedis) OpenPipeLine()
Initialize pipeLiners in the redis instance。
func (*XesRedis) SRandMember ¶
func (*XesRedis) SUnionStore ¶
func (*XesRedis) SetHandler ¶
func (this *XesRedis) SetHandler(handler redo.XesRedisHandler)
SetPipeLiner will set handler into redis client.
func (*XesRedis) SetInstanceIP ¶
SetInstanceIP will set redis server host into redis client.
func (*XesRedis) SetNX ¶
func (this *XesRedis) SetNX(keyName string, keyParams []interface{}, value interface{}, ex int64) (back string, err error)
返回类型不匹配,请使用SetNXBool,已废弃,兼容已上线服务保留
func (*XesRedis) SetPipeLineFlag ¶
func (this *XesRedis) SetPipeLineFlag()
SetPipeLineFlag will set goPipeLine flag into redis client.
func (*XesRedis) SetPipeLiner ¶
func (this *XesRedis) SetPipeLiner(pip map[string]*PipelineIns)
SetPipeLiner will set pipeLiners into redis client.