Documentation ¶
Index ¶
- 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 ...any) 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) any
- func (rd *Redis) GetEX(key string, seconds int) any
- func (rd *Redis) GetSet(key string, value any) any
- 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) any
- func (rd *Redis) HGetAll(key string) map[string]any
- 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) []any
- func (rd *Redis) HMSet(key string, fieldAndValues ...any) bool
- func (rd *Redis) HSet(key, field string, value any) bool
- func (rd *Redis) HSetNX(key, field string, value any) 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) any
- func (rd *Redis) LPush(key string, values ...string) int
- func (rd *Redis) LRange(key string, start, stop int) []any
- func (rd *Redis) MGet(keys ...string) []any
- func (rd *Redis) MSet(keyAndValues ...any) bool
- func (rd *Redis) Publish(channel, data string) bool
- func (rd *Redis) RPop(key string) any
- func (rd *Redis) RPush(key string, values ...string) int
- func (rd *Redis) Set(key string, value any) bool
- func (rd *Redis) SetEX(key string, seconds int, value any) bool
- func (rd *Redis) SetNX(key string, value any) bool
- type RedisObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
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.