feat:完善项目
This commit is contained in:
32
serve/cache/logic/redis_test.go
vendored
Normal file
32
serve/cache/logic/redis_test.go
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"github.com/go-redis/redis"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var redisClient *redis.Client
|
||||
|
||||
func InitRedis() {
|
||||
option := &redis.Options{
|
||||
Network: "",
|
||||
//Addr: this.Addr,
|
||||
//Password: this.Password,
|
||||
//DB: this.DB,
|
||||
//MinIdleConns: this.MinIdleConns,
|
||||
//IdleTimeout: time.Duration(this.IdleTimeout),
|
||||
}
|
||||
redisClient = redis.NewClient(option)
|
||||
|
||||
ping, err := redisClient.Ping().Result()
|
||||
|
||||
if err != nil {
|
||||
panic(ping + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewRedis(t *testing.T) {
|
||||
InitRedis()
|
||||
|
||||
//redisClient.
|
||||
}
|
Reference in New Issue
Block a user