This commit is contained in:
2022-03-17 15:55:27 +08:00
commit bd5a9fad97
92 changed files with 13861 additions and 0 deletions

32
logic/dao/main_test.go Normal file
View File

@@ -0,0 +1,32 @@
package dao
import (
"os"
"testing"
"time"
xtime "github.com/Terry-Mao/goim/pkg/time"
"github.com/gomodule/redigo/redis"
"gitlab.33.cn/chat/im/logic/conf"
)
var (
testConf *conf.Config
testRedis *redis.Pool
)
func TestMain(m *testing.M) {
testRedis = newRedis(&conf.Redis{
Network: "tcp",
Addr: "127.0.0.1:6379",
Auth: "",
Active: 60000,
Idle: 1024,
DialTimeout: xtime.Duration(200 * time.Millisecond),
ReadTimeout: xtime.Duration(500 * time.Millisecond),
WriteTimeout: xtime.Duration(500 * time.Millisecond),
IdleTimeout: xtime.Duration(120 * time.Second),
Expire: xtime.Duration(30 * time.Minute),
})
os.Exit(m.Run())
}