Documentation ¶
Index ¶
- func Decr(ctx *plugin.Context, key string) int64
- func DecrBy(ctx *plugin.Context, key string, increment int64) int64
- func Del(ctx *plugin.Context, keys ...string) int
- func Destroy(ctx *plugin.Context) error
- func Do(ctx *plugin.Context, cmd string, values ...interface{}) string
- func Exists(ctx *plugin.Context, key string) bool
- func Expire(ctx *plugin.Context, key string, seconds int) bool
- func ExpireAt(ctx *plugin.Context, key string, time int) bool
- func Get(ctx *plugin.Context, key string) interface{}
- func GetEX(ctx *plugin.Context, key string, seconds int) interface{}
- func GetSet(ctx *plugin.Context, key string, value interface{}) interface{}
- func HDecr(ctx *plugin.Context, key, field string) int64
- func HDecrBy(ctx *plugin.Context, key, field string, increment int64) int64
- func HDel(ctx *plugin.Context, key string, fields ...string) int
- func HExists(ctx *plugin.Context, key, field string) bool
- func HGet(ctx *plugin.Context, key, field string) interface{}
- func HGetAll(ctx *plugin.Context, key string) map[string]interface{}
- func HIncr(ctx *plugin.Context, key, field string) int64
- func HIncrBy(ctx *plugin.Context, key, field string, increment int64) int64
- func HKeys(ctx *plugin.Context, patten string) []string
- func HLen(ctx *plugin.Context, key string) int
- func HMGet(ctx *plugin.Context, key string, fields ...string) []interface{}
- func HMSet(ctx *plugin.Context, key string, fieldAndValues ...interface{}) bool
- func HSet(ctx *plugin.Context, key, field string, value interface{}) bool
- func HSetNX(ctx *plugin.Context, key, field string, value interface{}) bool
- func Incr(ctx *plugin.Context, key string) int64
- func IncrBy(ctx *plugin.Context, key string, increment int64) int64
- func Keys(ctx *plugin.Context, patten string) []string
- func LLen(ctx *plugin.Context, key string) int
- func LPop(ctx *plugin.Context, key string) interface{}
- func LPush(ctx *plugin.Context, key string, values ...string) int
- func LRange(ctx *plugin.Context, key string, start, stop int) []interface{}
- func MGet(ctx *plugin.Context, keys ...string) []interface{}
- func MSet(ctx *plugin.Context, keyAndValues ...interface{}) bool
- func Publish(ctx *plugin.Context, channel, data string) bool
- func RPop(ctx *plugin.Context, key string) interface{}
- func RPush(ctx *plugin.Context, key string, values ...string) int
- func Set(ctx *plugin.Context, key string, value interface{}) bool
- func SetEX(ctx *plugin.Context, key string, seconds int, value interface{}) bool
- func SetNX(ctx *plugin.Context, key string, value interface{}) bool
- type Redis
- func (rd *Redis) Decr(key string) int64
- func (rd *Redis) DecrBy(key string, increment int64) int64
- func (rd *Redis) Del(keys ...string) int
- func (rd *Redis) Destroy() error
- func (rd *Redis) Do(cmd string, values ...interface{}) string
- func (rd *Redis) Exists(key string) bool
- func (rd *Redis) Expire(key string, seconds int) bool
- func (rd *Redis) ExpireAt(key string, time int) bool
- func (rd *Redis) Get(key string) interface{}
- func (rd *Redis) GetEX(key string, seconds int) interface{}
- func (rd *Redis) GetSet(key string, value interface{}) interface{}
- func (rd *Redis) HDecr(key, field string) int64
- func (rd *Redis) HDecrBy(key, field string, increment int64) int64
- func (rd *Redis) HDel(key string, fields ...string) int
- func (rd *Redis) HExists(key, field string) bool
- func (rd *Redis) HGet(key, field string) interface{}
- func (rd *Redis) HGetAll(key string) map[string]interface{}
- func (rd *Redis) HIncr(key, field string) int64
- func (rd *Redis) HIncrBy(key, field string, increment int64) int64
- func (rd *Redis) HKeys(patten string) []string
- func (rd *Redis) HLen(key string) int
- func (rd *Redis) HMGet(key string, fields ...string) []interface{}
- func (rd *Redis) HMSet(key string, fieldAndValues ...interface{}) bool
- func (rd *Redis) HSet(key, field string, value interface{}) bool
- func (rd *Redis) HSetNX(key, field string, value interface{}) bool
- func (rd *Redis) Incr(key string) int64
- func (rd *Redis) IncrBy(key string, increment int64) int64
- func (rd *Redis) Keys(patten string) []string
- func (rd *Redis) LLen(key string) int
- func (rd *Redis) LPop(key string) interface{}
- func (rd *Redis) LPush(key string, values ...string) int
- func (rd *Redis) LRange(key string, start, stop int) []interface{}
- func (rd *Redis) MGet(keys ...string) []interface{}
- func (rd *Redis) MSet(keyAndValues ...interface{}) bool
- func (rd *Redis) Publish(channel, data string) bool
- func (rd *Redis) RPop(key string) interface{}
- func (rd *Redis) RPush(key string, values ...string) int
- func (rd *Redis) Set(key string, value interface{}) bool
- func (rd *Redis) SetEX(key string, seconds int, value interface{}) bool
- func (rd *Redis) SetNX(key string, value interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func GetRedis ¶
GetRedis 获得Redis连接 GetRedis name 连接配置名称,如果不提供名称则使用默认连接 GetRedis return Redis连接,对象内置连接池操作,完成后无需手动关闭连接
func (*Redis) Do ¶
Do 执行Redis操作,这是底层接口 Do cmd 命令 Do values 参数,根据命令传入不同参数 Do return 返回字符串数据,需要根据数据内容自行解析处理
func (*Redis) ExpireAt ¶
ExpireAt 设置Key的过期时间(指定具体时间) ExpireAt time 过期时间的时间戳,单位秒 ExpireAt return 是否成功
func (*Redis) HGetAll ¶
HGetAll 获取在哈希表中指定 key 的所有字段和值 HGetAll return 返回所有字段的值,如果值是一个对象则返回反序列化后的对象,否则返回字符串
func (*Redis) MGet ¶
MGet 获取所有(一个或多个)给定 key 的值 MGet return []any 按照查询key的顺序返回结果,如果结果是一个对象则返回反序列化后的对象,否则返回字符串
Click to show internal directories.
Click to hide internal directories.