Documentation ¶
Overview ¶
*
- @copyright 像衍科技-idr.ai
- @author 牛牛-研发部-www.ruomm.com
- @create 2024/1/16 10:22
- @version 1.0
Index ¶
- func RedisClientInit(appEnv string, redisConfig interface{})
- type XRedisClient
- func (t *XRedisClient) Del(key string) error
- func (t *XRedisClient) Exists(key string) (bool, error)
- func (t *XRedisClient) GetBool(key string) (bool, error)
- func (t *XRedisClient) GetFloat64(key string) (float64, error)
- func (t *XRedisClient) GetInt(key string) (int, error)
- func (t *XRedisClient) GetInt64(key string) (int64, error)
- func (t *XRedisClient) GetObject(key string, v interface{}) error
- func (t *XRedisClient) GetString(key string) (string, error)
- func (t *XRedisClient) GetUint64(key string) (uint64, error)
- func (t *XRedisClient) InitPull()
- func (t *XRedisClient) Set(key string, value interface{}) error
- func (t *XRedisClient) SetEx(key string, expiresAt int, value interface{}) error
- func (t *XRedisClient) SetExObject(key string, expiresAt int, value interface{}) error
- func (t *XRedisClient) SetObject(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type XRedisClient ¶
type XRedisClient struct { // 环境变量信息,用于生成特定的环境值 AppEnv string `xref:"AppEnv"` //# 主机名称 Host string `xref:"Host"` //# 端口 Port int `xref:"Port"` //# 密码 Password string `xref:"Password"` // # 自定义客户端名称 ClientName string `xref:"ClientName"` //# 使用的数据库 DbIndex int `xref:"DbIndex"` //# 最大闲置连接数 MaxIdle int `xref:"MaxIdle"` //# 最大活动连接数 MaxActive int `xref:"MaxActive"` //# 闲置过期时间 IdleTimeout int `xref:"IdleTimeout"` //# 连接最长生存时间 如果超过时间会被从链表中删除 MaxConnLifeTime int `xref:"MaxConnLifeTime"` //# If Wait is true and the pool is at the MaxActive limit, then Get() waits //# for a connection to be returned to the pool before returning. WaitEnable bool `xref:"WaitEnable"` RedisPool *redis.Pool }
func (*XRedisClient) Del ¶ added in v1.2.4
func (t *XRedisClient) Del(key string) error
redis删除指定的key
func (*XRedisClient) Exists ¶ added in v1.2.4
func (t *XRedisClient) Exists(key string) (bool, error)
redis检索指定的key是否存在
func (*XRedisClient) GetBool ¶ added in v1.8.6
func (t *XRedisClient) GetBool(key string) (bool, error)
redis依据key获取bool
func (*XRedisClient) GetFloat64 ¶ added in v1.8.6
func (t *XRedisClient) GetFloat64(key string) (float64, error)
redis依据key获取Float64
func (*XRedisClient) GetInt ¶
func (t *XRedisClient) GetInt(key string) (int, error)
redis依据key获取Int
func (*XRedisClient) GetInt64 ¶
func (t *XRedisClient) GetInt64(key string) (int64, error)
redis依据key获取Int64
func (*XRedisClient) GetObject ¶
func (t *XRedisClient) GetObject(key string, v interface{}) error
redis依据key获取对象,使用JSON解析
func (*XRedisClient) GetString ¶
func (t *XRedisClient) GetString(key string) (string, error)
redis依据key获取字符串
func (*XRedisClient) GetUint64 ¶ added in v1.8.6
func (t *XRedisClient) GetUint64(key string) (uint64, error)
redis依据key获取Uint64
func (*XRedisClient) Set ¶
func (t *XRedisClient) Set(key string, value interface{}) error
redis设置key-value
func (*XRedisClient) SetEx ¶
func (t *XRedisClient) SetEx(key string, expiresAt int, value interface{}) error
redis设置key-expiresAt-value
func (*XRedisClient) SetExObject ¶
func (t *XRedisClient) SetExObject(key string, expiresAt int, value interface{}) error
redis设置key-expiresAt-value
func (*XRedisClient) SetObject ¶
func (t *XRedisClient) SetObject(key string, value interface{}) error
redis设置key-value
Click to show internal directories.
Click to hide internal directories.