35 lines
770 B
Go
35 lines
770 B
Go
|
package db
|
||
|
|
||
|
type DBConfig struct {
|
||
|
Driver string
|
||
|
//ReadHost []string
|
||
|
//WriteHost []string
|
||
|
Host string
|
||
|
Port string
|
||
|
Database string
|
||
|
Username string
|
||
|
Password string
|
||
|
Charset string
|
||
|
Prefix string
|
||
|
ConnMaxLifetime int
|
||
|
ConnMaxIdleTime int
|
||
|
MaxIdleConns int
|
||
|
MaxOpenConns int
|
||
|
ParseTime bool
|
||
|
// mysql
|
||
|
Collation string
|
||
|
UnixSocket string
|
||
|
MultiStatements bool
|
||
|
Dsn string
|
||
|
// pgsql
|
||
|
Sslmode string
|
||
|
TLS string
|
||
|
EnableLog bool
|
||
|
// sqlite3
|
||
|
File string
|
||
|
Journal string // DELETE TRUNCATE PERSIST MEMORY WAL OFF
|
||
|
Locking string // NORMAL EXCLUSIVE
|
||
|
Mode string // ro rw rwc memory
|
||
|
Synchronous int // 0 OFF | 1 NORMAL | 2 FULL | 3 EXTRA
|
||
|
}
|