You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
321 B
Go
21 lines
321 B
Go
1 year ago
|
package redistab
|
||
|
|
||
|
import "github.com/go-redis/redis"
|
||
|
|
||
|
var RedisClient *redis.Client
|
||
|
|
||
|
func init() {
|
||
|
RedisClient = redis.NewClient(&redis.Options{
|
||
|
Addr: "127.0.0.1:6379",
|
||
|
Password: "",
|
||
|
PoolSize: 20,
|
||
|
DB: 1,
|
||
|
})
|
||
|
// 检测
|
||
|
_, err := RedisClient.Ping().Result()
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
return
|
||
|
}
|
||
|
}
|