A:数据库初始化,并增加User表示例
This commit is contained in:
1 parent
da2222f2d9
commit
b8dc199cff
15 files changed
+1459
-108
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// DatabaseConfig 数据库配置
|
||||
type DatabaseConfig struct {
|
||||
Type DatabaseType
|
||||
// Mysql 属性
|
||||
Host string
|
||||
// Mysql 属性
|
||||
Port string
|
||||
Database string
|
||||
// Mysql 属性
|
||||
Username string
|
||||
// Mysql 属性
|
||||
Password string
|
||||
// SQLite specific
|
||||
DBPath string
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
MaxLifetime time.Duration
|
||||
}
|
||||
|
||||
// DatabaseType 数据库类型
|
||||
type DatabaseType string
|
||||
|
||||
const (
|
||||
SQLite DatabaseType = "sqlite"
|
||||
MySQL DatabaseType = "mysql"
|
||||
)
|
||||
Reference in new issue
Block a user