Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoInit = errors.New("eRedis: please initialize with eRedis.Init()")
Functions ¶
func GetClientByConf ¶
GetClientByConf 获取redis客户端 @param conf 配置 @param defaultDB 默认数据库 @return *redis.Client
func Init ¶
Init 初始化 Example:
connectConf = map[string]Conf{ "localhost": { Host: viper.GetString("REDIS_LOCALHOST_RW_HOST"), Password: viper.GetString("REDIS_LOCALHOST_RW_PASSWORD"), Port: viper.GetInt("REDIS_LOCALHOST_RW_PORT"), PoolSize: viper.GetInt("REDIS_LOCALHOST_POOL_SIZE"), MinIdleConn: viper.GetInt("REDIS_LOCALHOST_MIN_IDLE_CONN"), IdleTimeout: viper.GetDuration("REDIS_LOCALHOST_IDLE_TIMEOUT"), }, }
Types ¶
Click to show internal directories.
Click to hide internal directories.