Documentation ¶
Index ¶
- func Del(keys ...string) error
- func DelCli(cli *RedisClienterInstance, keys ...string) error
- func Eval(script string, key string, args []any) (any, bool, error)
- func EvalCli(cli *RedisClienterInstance, script string, key string, args []any) (any, bool, error)
- func Exists(key any) (bool, error)
- func ExistsCli(cli *RedisClienterInstance, key any) (bool, error)
- func Expire(key any, t time.Duration) (err error)
- func ExpireCli(cli *RedisClienterInstance, key any, t time.Duration) (err error)
- func Get(key string) (value string, err error)
- func GetCli(cli *RedisClienterInstance, key string) (string, error)
- func GetExt(key any, p any) (exists bool, err error)
- func GetExtCli(cli *RedisClienterInstance, key any, p any) (exists bool, err error)
- func HDel(key string, fields ...string) error
- func HDelCli(cli *RedisClienterInstance, key string, fields ...string) error
- func HExists(key any, field any) (bool, error)
- func HExistsCli(cli *RedisClienterInstance, key any, field any) (bool, error)
- func HGet(key any, field any) string
- func HGetCli(cli *RedisClienterInstance, key any, field any) string
- func HGetExt(key any, field any, p any) (exists bool, ok bool)
- func HGetExtCli(cli *RedisClienterInstance, key any, field any, p any) (exists bool, ok bool)
- func HIncrBy(rk, hk string, hv int64) int64
- func HIncrByCli(cli *RedisClienterInstance, rk, hk string, hv int64) int64
- func HKeys(key any) (field []string, err error)
- func HKeysCli(cli *RedisClienterInstance, key any) (field []string, err error)
- func HLen(key any) (int64, error)
- func HLenCli(cli *RedisClienterInstance, key any) (int64, error)
- func HSet(key any, field any, p any) bool
- func HSetCli(cli *RedisClienterInstance, key any, field any, p any) bool
- func HSetExt(key any, field any, p any) (err error)
- func HSetExtCli(cli *RedisClienterInstance, key any, field any, p any) (err error)
- func HVals(key any) (p []string, err error)
- func HValsCli(cli *RedisClienterInstance, key any) (p []string, err error)
- func HValsExt(key any, p any) (err error)
- func HValsExtCli(cli *RedisClienterInstance, key any, p any) (err error)
- func Init(addr, username, password string, db int32)
- func Keys(key any) (field []string, err error)
- func KeysCli(cli *RedisClienterInstance, key any) (field []string, err error)
- func LLen(key any) (int64, error)
- func LLenCli(cli *RedisClienterInstance, key any) (int64, error)
- func LPop(key any) (value string, err error)
- func LPopCli(cli *RedisClienterInstance, key any) (value string, err error)
- func LPushCli(cli *RedisClienterInstance, key string, val string) (err error)
- func LPushExt(key any, p any) (err error)
- func LPushExtCli(cli *RedisClienterInstance, key any, p any) (err error)
- func LRangeCli(cli *RedisClienterInstance, key string, start, stop int64) (error, []string)
- func LRangeExt(key any, slicePrt any, start, stop int64) (err error)
- func LRangeExtCli(cli *RedisClienterInstance, key any, slicePrt any, start, stop int64) (err error)
- func LTrimCli(cli *RedisClienterInstance, key string, start, stop int64) error
- func Persist(key any) (err error)
- func PersistCli(cli *RedisClienterInstance, key any) (err error)
- func RPop(key any) (value string, err error)
- func RPopCli(cli *RedisClienterInstance, key any) (value string, err error)
- func RPush(key, value string) (err error)
- func RPushCli(cli *RedisClienterInstance, key string, value string) (err error)
- func RPushExt(key any, p any) (err error)
- func RPushExtCli(cli *RedisClienterInstance, key any, p any) (err error)
- func Set(key, value string) error
- func SetCasWithTTL(key, oldValue, newValue string, second int64) (bool, error)
- func SetCli(cli *RedisClienterInstance, key, value string, ttl time.Duration) error
- func SetCliCas(cli *RedisClienterInstance, key, oldValue, newValue string, second int64) (bool, error)
- func SetExt(key any, p any) (err error)
- func SetExtCli(cli *RedisClienterInstance, key any, p any) (err error)
- func SetWithTTL(key, value string, ttl time.Duration) error
- func TTL(key any) (s time.Duration, err error)
- func TTLCli(cli *RedisClienterInstance, key any) (s time.Duration, err error)
- func ZAdd(key string, score float64, member string) (err error)
- func ZAddCli(cli *RedisClienterInstance, key string, score float64, member string) (err error)
- func ZCard(key string) (cnt int64, err error)
- func ZCardCli(cli *RedisClienterInstance, key string) (cnt int64, err error)
- func ZIncrBy(key string, score float64, member string) (err error)
- func ZIncrByCli(cli *RedisClienterInstance, key string, score float64, member string) (err error)
- func ZRangeByScore(key string, min, max string, offset, count int64) (err error, memberResult []string)
- func ZRangeByScoreCli(cli *RedisClienterInstance, key string, min, max string, offset, count int64) (err error, memberResult []string)
- func ZRangeByScoreWithScores(key string, min, max string, offset, count int64) (err error, memberResult []string, scoreResult []float64)
- func ZRangeByScoreWithScoresCli(cli *RedisClienterInstance, key string, min, max string, offset, count int64) (err error, memberResult []string, scoreResult []float64)
- func ZRangeWithScores(key string, start, stop int64) (err error, memberResult []string, scoreResult []float64)
- func ZRangeWithScoresCli(cli *RedisClienterInstance, key string, start, stop int64) (err error, memberResult []string, scoreResult []float64)
- func ZRank(key string, member string) (rank int64, err error)
- func ZRankCli(cli *RedisClienterInstance, key string, member string) (rank int64, err error)
- func ZRem(key string, member ...string) error
- func ZRemCli(cli *RedisClienterInstance, key string, member ...string) error
- func ZRevRange(key string, start, stop int64) (err error, memberResult []string)
- func ZRevRangeByScoreWithScores(key string, min, max string, offset, count int64) (err error, memberResult []string, scoreResult []float64)
- func ZRevRangeByScoreWithScoresCli(cli *RedisClienterInstance, key string, min, max string, offset, count int64) (err error, memberResult []string, scoreResult []float64)
- func ZRevRangeCli(cli *RedisClienterInstance, key string, start, stop int64) (err error, memberResult []string)
- func ZRevRangeWithScores(key string, start, stop int64) (err error, memberResult []string, scoreResult []float64)
- func ZRevRangeWithScoresCli(cli *RedisClienterInstance, key string, start, stop int64) (err error, memberResult []string, scoreResult []float64)
- func ZRevRank(key string, member string) (rank int64, err error)
- func ZRevRankCli(cli *RedisClienterInstance, key string, member string) (rank int64, err error)
- func ZScore(key string, member string) (score float64, err error)
- func ZScoreCli(cli *RedisClienterInstance, key string, member string) (score float64, err error)
- type RedisClienterInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelCli ¶ added in v0.0.47
func DelCli(cli *RedisClienterInstance, keys ...string) error
func ExpireCli ¶ added in v0.0.47
func ExpireCli(cli *RedisClienterInstance, key any, t time.Duration) (err error)
func GetExtCli ¶ added in v0.0.47
func GetExtCli(cli *RedisClienterInstance, key any, p any) (exists bool, err error)
func HDelCli ¶ added in v0.0.47
func HDelCli(cli *RedisClienterInstance, key string, fields ...string) error
func HExistsCli ¶ added in v0.0.47
func HExistsCli(cli *RedisClienterInstance, key any, field any) (bool, error)
func HGetExtCli ¶ added in v0.0.47
func HIncrByCli ¶ added in v0.0.47
func HIncrByCli(cli *RedisClienterInstance, rk, hk string, hv int64) int64
func HKeysCli ¶ added in v0.0.47
func HKeysCli(cli *RedisClienterInstance, key any) (field []string, err error)
func HSetCli ¶ added in v0.0.47
func HSetCli(cli *RedisClienterInstance, key any, field any, p any) bool
func HSetExtCli ¶ added in v0.0.47
func HSetExtCli(cli *RedisClienterInstance, key any, field any, p any) (err error)
func HValsCli ¶ added in v0.0.71
func HValsCli(cli *RedisClienterInstance, key any) (p []string, err error)
func HValsExtCli ¶ added in v0.0.47
func HValsExtCli(cli *RedisClienterInstance, key any, p any) (err error)
func KeysCli ¶ added in v0.0.54
func KeysCli(cli *RedisClienterInstance, key any) (field []string, err error)
func LPopCli ¶ added in v0.0.47
func LPopCli(cli *RedisClienterInstance, key any) (value string, err error)
func LPushCli ¶ added in v0.0.124
func LPushCli(cli *RedisClienterInstance, key string, val string) (err error)
func LPushExtCli ¶ added in v0.0.47
func LPushExtCli(cli *RedisClienterInstance, key any, p any) (err error)
func LRangeCli ¶ added in v0.0.124
func LRangeCli(cli *RedisClienterInstance, key string, start, stop int64) (error, []string)
func LRangeExtCli ¶ added in v0.0.47
func LRangeExtCli(cli *RedisClienterInstance, key any, slicePrt any, start, stop int64) (err error)
func LTrimCli ¶ added in v0.0.124
func LTrimCli(cli *RedisClienterInstance, key string, start, stop int64) error
func PersistCli ¶ added in v0.0.47
func PersistCli(cli *RedisClienterInstance, key any) (err error)
func RPopCli ¶ added in v0.0.47
func RPopCli(cli *RedisClienterInstance, key any) (value string, err error)
func RPushCli ¶ added in v0.0.86
func RPushCli(cli *RedisClienterInstance, key string, value string) (err error)
func RPushExtCli ¶ added in v0.0.47
func RPushExtCli(cli *RedisClienterInstance, key any, p any) (err error)
func SetCasWithTTL ¶ added in v0.0.82
func SetCli ¶ added in v0.0.47
func SetCli(cli *RedisClienterInstance, key, value string, ttl time.Duration) error
-1 永不过期
func SetCliCas ¶ added in v0.0.82
func SetCliCas(cli *RedisClienterInstance, key, oldValue, newValue string, second int64) (bool, error)
String CompareAndSwap 带 ttl
当 key 不存在时:
写入 newValue 返回 true
当 key 存在时:
当 value==oldValue 时,写入 newValue 返回 true 当 value!=oldValue 时,返回 false
func SetExtCli ¶ added in v0.0.47
func SetExtCli(cli *RedisClienterInstance, key any, p any) (err error)
func TTLCli ¶ added in v0.0.47
func TTLCli(cli *RedisClienterInstance, key any) (s time.Duration, err error)
func ZAddCli ¶ added in v0.0.47
func ZAddCli(cli *RedisClienterInstance, key string, score float64, member string) (err error)
func ZCardCli ¶ added in v0.0.47
func ZCardCli(cli *RedisClienterInstance, key string) (cnt int64, err error)
func ZIncrByCli ¶ added in v0.0.47
func ZIncrByCli(cli *RedisClienterInstance, key string, score float64, member string) (err error)
func ZRangeByScore ¶ added in v0.0.76
func ZRangeByScoreCli ¶ added in v0.0.76
func ZRangeByScoreWithScores ¶ added in v0.0.75
func ZRangeByScoreWithScoresCli ¶ added in v0.0.75
func ZRangeWithScores ¶
func ZRangeWithScoresCli ¶ added in v0.0.47
func ZRankCli ¶ added in v0.0.47
func ZRankCli(cli *RedisClienterInstance, key string, member string) (rank int64, err error)
func ZRemCli ¶ added in v0.0.47
func ZRemCli(cli *RedisClienterInstance, key string, member ...string) error
func ZRevRangeByScoreWithScores ¶ added in v0.0.74
func ZRevRangeByScoreWithScoresCli ¶ added in v0.0.74
func ZRevRangeCli ¶ added in v0.0.47
func ZRevRangeCli(cli *RedisClienterInstance, key string, start, stop int64) (err error, memberResult []string)
func ZRevRangeWithScores ¶
func ZRevRangeWithScoresCli ¶ added in v0.0.47
func ZRevRank ¶
ZREVRANK key:键, rank排名 第1名为0, 无排名为-1 (降序)
有数据 cmd.Err()==nil
无数据 cmd.Err()==redis.Nil
func ZRevRankCli ¶ added in v0.0.47
func ZRevRankCli(cli *RedisClienterInstance, key string, member string) (rank int64, err error)
Types ¶
type RedisClienterInstance ¶ added in v0.0.47
type RedisClienterInstance struct { Rc *redis.Client // contains filtered or unexported fields }
var DefaultClient *RedisClienterInstance
func New ¶ added in v0.0.47
func New(addr, username, password string, db int32) *RedisClienterInstance
Click to show internal directories.
Click to hide internal directories.