Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultPgDSN default PostgreSQL test connection string DefaultPgDSN = "postgres://postgres:yzy123@192.168.110.249:5432/test?sslmode=disable" // DefaultMySQLDSN default MySQL test connection string DefaultMySQLDSN = "root:123456@tcp(10.0.1.5:3306)/test?charset=utf8mb4&parseTime=True" )
View Source
var TestMySQLDSN = DefaultMySQLDSN
TestMySQLDSN current MySQL test connection string
View Source
var TestPgDSN = DefaultPgDSN
TestPgDSN current PostgreSQL test connection string
Functions ¶
func CleanupTestDB ¶ added in v4.1.5
CleanupTestDB 清理测试数据库
func SetupTestDB ¶ added in v4.1.5
func SetupTestDB(config TestDBConfig) (*sql.DB, error)
SetupTestDB 设置测试数据库
Types ¶
type TestDBConfig ¶ added in v4.1.5
type TestDBConfig struct {
Driver string
Host string
Port int
User string
Password string
DBName string
}
TestDBConfig 测试数据库配置
func DefaultMySQLConfig ¶ added in v4.1.5
func DefaultMySQLConfig() TestDBConfig
DefaultMySQLConfig 返回默认的MySQL测试配置
func DefaultPostgresConfig ¶ added in v4.1.5
func DefaultPostgresConfig() TestDBConfig
DefaultPostgresConfig 返回默认的PostgreSQL测试配置
Click to show internal directories.
Click to hide internal directories.