1 Star 0 Fork 0

lorock / goconfig

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
redispool.go 520 Bytes
一键复制 编辑 原始数据 按行查看 历史
lorock 提交于 2020-11-21 16:42 . 代码优化
package redispool
import (
"github.com/go-redis/redis"
"github.com/sirupsen/logrus"
)
// NewRedisPool redis连接池
func NewRedisPool(redisIP, redisPort, redisPassword string, redisDB int) *redis.Client {
client := redis.NewClient(&redis.Options{
Addr: redisIP + ":" + redisPort,
Password: redisPassword, // no password set
DB: redisDB, // use default DB
})
// defer rdb.Close()
pong, err := client.Ping().Result()
if err != nil {
logrus.Errorln("Redis", pong, err)
}
return client
}
Go
1
https://gitee.com/lorock/goconfig.git
git@gitee.com:lorock/goconfig.git
lorock
goconfig
goconfig
v0.0.9

搜索帮助