Documentation
¶
Index ¶
- Variables
- func GetCtx() context.Context
- func Init(cfg *config.RedisConfig) bool
- func PubSubConn(db string) *redis.Client
- func RDel(key string)
- func REval(script string, keys []string, args ...interface{}) (interface{}, error)
- func RExists(key string) bool
- func RExpire(key string, time int)
- func RGet(key string) string
- func RGetAny(keys ...string) []string
- func RHDel(key string, field string)
- func RHExists(key string, field string) bool
- func RHGet(key string, field string) string
- func RHGetAll(key string) map[string]string
- func RHIncrBy(key string, field string, num int)
- func RHIncrByEx(key string, field string, num int, expire int)
- func RHLen(key string) int64
- func RHMGet(key string, field ...string) []string
- func RHMSet(key string, fieldValue ...string)
- func RHMSetEx(key string, expire int, fieldValue ...string)
- func RHSet(key string, field string, value string)
- func RHSetEx(key string, field string, value string, expire int)
- func RHSetNX(key string, field string, value string) bool
- func RHValues(key string) []string
- func RIncr(key string)
- func RIncrBy(key string, num int)
- func RIncrByValue(key string, num int) int64
- func RLLPop(key string) string
- func RLLPush(key string, value ...string)
- func RLLen(key string) int64
- func RLRPop(key string) string
- func RLRPush(key string, value ...string)
- func RLRange(key string, start, end int) []string
- func RSAdd(key string, value ...string)
- func RSAddEx(key string, expire int, value ...string)
- func RSCard(key string) int64
- func RSMembers(key string) []string
- func RSRem(key string, value ...string)
- func RSet(key string, value string)
- func RSetEX(key string, value string, expire int)
- func RSetNX(key string, value string) bool
- func RSetNxAndEx(key string, value string, expire int) bool
- func RTtl(key string) (time.Duration, error)
- func RZAdd(key string, member string, score float64)
- func RZAddEx(key string, member string, score float64, expire int)
- func RZAdds(key string, arg ...interface{})
- func RZAddsEx(key string, expire int, arg ...interface{})
- func RZCard(key string) int64
- func RZIncrBy(key string, member string, score float64)
- func RZRange(key string, start, end int, withScore, isRev bool) [][]string
- func RZRangeByScore(key string, min, max float64, withScore, isRev bool) [][]string
- func RZRangeByScoreLimit(key string, min, max float64, withScore, isRev bool, offset, count int) [][]string
- func RZRank(key string, member string, isRev bool) (int64, error)
- func RZRem(key string, member ...string)
- func RZRemByRank(key string, start, stop int64) (int64, error)
- func RZScore(key string, member string) (float64, error)
- type RConfig
- type RServerConfig
- type RUtil
Constants ¶
This section is empty.
Variables ¶
View Source
var Util = &RUtil{}
Functions ¶
func Init ¶
func Init(cfg *config.RedisConfig) bool
func PubSubConn ¶
func PubSubConn(db string) *redis.Client
func RIncrByValue ¶
func RZRangeByScore ¶
func RZRangeByScoreLimit ¶
Types ¶
type RConfig ¶
type RConfig struct { MinIdle int // 在启动阶段创建指定数量的Idle连接,并长期维持idle状态的连接数不少于指定数量;。 MaxActive int // 连接池最大socket连接数,默认为4倍CPU数, 4 * runtime.NumCPU DialTimeout int // 连接建立超时时间,默认5秒。 ReadTimeout int // 读超时,默认3秒, -1表示取消读超时 WriteTimeout int // 写超时,默认等于读超时 PoolTimeout int // 当所有连接都处在繁忙状态时,客户端等待可用连接的最大等待时长,默认为读超时+1秒。 IdleTimeout int // 闲置超时,默认5分钟,-1表示取消闲置超时检查 IdleCheckFrequency int // 闲置连接检查的周期,默认为1分钟,-1表示不做周期性检查,只在客户端获取连接时对闲置连接进行处理。 MaxConnAge int // 连接存活时长,从创建开始计时,超过指定时长则关闭连接,默认为0,即不关闭存活时长较长的连接 MaxRetries int // 命令执行失败时,最多重试多少次,默认为0即不重试 MinRetryBackoff int // 每次计算重试间隔时间的下限,默认8毫秒,-1表示取消间隔 MaxRetryBackoff int // 每次计算重试间隔时间的上限,默认512毫秒,-1表示取消间隔 Configs []RServerConfig }
Click to show internal directories.
Click to hide internal directories.