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) 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) 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 ¶
func RedisClientInit ¶
func RedisClientInit(appEnv string, redisConfig interface{})
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 SingleRedisClient ¶
func SingleRedisClient() *XRedisClient
func (*XRedisClient) GetObject ¶
func (t *XRedisClient) GetObject(key string, v interface{}) error
func (*XRedisClient) InitPull ¶
func (t *XRedisClient) InitPull()
func (*XRedisClient) Set ¶
func (t *XRedisClient) Set(key string, value interface{}) error
func (*XRedisClient) SetEx ¶
func (t *XRedisClient) SetEx(key string, expiresAt int, value interface{}) error
func (*XRedisClient) SetExObject ¶
func (t *XRedisClient) SetExObject(key string, expiresAt int, value interface{}) error
func (*XRedisClient) SetObject ¶
func (t *XRedisClient) SetObject(key string, value interface{}) error
Click to show internal directories.
Click to hide internal directories.