xredis

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

*

  • @copyright 像衍科技-idr.ai
  • @author 牛牛-研发部-www.ruomm.com
  • @create 2024/1/16 10:22
  • @version 1.0

Index

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) GetInt

func (t *XRedisClient) GetInt(key string) (int, error)

func (*XRedisClient) GetInt64

func (t *XRedisClient) GetInt64(key string) (int64, error)

func (*XRedisClient) GetObject

func (t *XRedisClient) GetObject(key string, v interface{}) error

func (*XRedisClient) GetString

func (t *XRedisClient) GetString(key string) (string, 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL