redis

package
v0.0.0-...-7206171 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Util = &RUtil{}

Functions

func GetCtx

func GetCtx() context.Context

func Init

func Init(cfg *config.RedisConfig) bool

func PubSubConn

func PubSubConn(db string) *redis.Client

func RDel

func RDel(key string)

func REval

func REval(script string, keys []string, args ...interface{}) (interface{}, error)

func RExists

func RExists(key string) bool

func RExpire

func RExpire(key string, time int)

func RGet

func RGet(key string) string

func RGetAny

func RGetAny(keys ...string) []string

func RHDel

func RHDel(key string, field string)

func RHExists

func RHExists(key string, field string) bool

func RHGet

func RHGet(key string, field string) string

func RHGetAll

func RHGetAll(key string) map[string]string

func RHIncrBy

func RHIncrBy(key string, field string, num int)

func RHIncrByEx

func RHIncrByEx(key string, field string, num int, expire int)

func RHLen

func RHLen(key string) int64

func RHMGet

func RHMGet(key string, field ...string) []string

func RHMSet

func RHMSet(key string, fieldValue ...string)

func RHMSetEx

func RHMSetEx(key string, expire int, fieldValue ...string)

func RHSet

func RHSet(key string, field string, value string)

func RHSetEx

func RHSetEx(key string, field string, value string, expire int)

func RHSetNX

func RHSetNX(key string, field string, value string) bool

func RHValues

func RHValues(key string) []string

func RIncr

func RIncr(key string)

func RIncrBy

func RIncrBy(key string, num int)

func RIncrByValue

func RIncrByValue(key string, num int) int64

func RLLPop

func RLLPop(key string) string

func RLLPush

func RLLPush(key string, value ...string)

func RLLen

func RLLen(key string) int64

func RLRPop

func RLRPop(key string) string

func RLRPush

func RLRPush(key string, value ...string)

func RLRange

func RLRange(key string, start, end int) []string

func RSAdd

func RSAdd(key string, value ...string)

func RSAddEx

func RSAddEx(key string, expire int, value ...string)

func RSCard

func RSCard(key string) int64

func RSMembers

func RSMembers(key string) []string

func RSRem

func RSRem(key string, value ...string)

func RSet

func RSet(key string, value string)

func RSetEX

func RSetEX(key string, value string, expire int)

func RSetNX

func RSetNX(key string, value string) bool

func RSetNxAndEx

func RSetNxAndEx(key string, value string, expire int) bool

func RTtl

func RTtl(key string) (time.Duration, error)

func RZAdd

func RZAdd(key string, member string, score float64)

func RZAddEx

func RZAddEx(key string, member string, score float64, expire int)

func RZAdds

func RZAdds(key string, arg ...interface{})

func RZAddsEx

func RZAddsEx(key string, expire int, arg ...interface{})

func RZCard

func RZCard(key string) int64

func RZIncrBy

func RZIncrBy(key string, member string, score float64)

func RZRange

func RZRange(key string, start, end int, withScore, isRev bool) [][]string

func RZRangeByScore

func RZRangeByScore(key string, min, max float64, withScore, isRev bool) [][]string

func RZRangeByScoreLimit

func RZRangeByScoreLimit(key string, min, max float64, withScore, isRev bool, offset, count int) [][]string

func RZRank

func RZRank(key string, member string, isRev bool) (int64, error)

RZRank 0为开始

func RZRem

func RZRem(key string, member ...string)

func RZRemByRank

func RZRemByRank(key string, start, stop int64) (int64, error)

func RZScore

func RZScore(key string, member string) (float64, error)

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
}

type RServerConfig

type RServerConfig struct {
	Name     string
	Ip       string
	Password string
	Db       int
}

type RUtil

type RUtil struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL