Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InitGormV2 ¶
func InitGormV2(c *MySQLConfig) (db *gorm.DB)
Types ¶
type MySQLConfig ¶
type MySQLConfig struct { DSN string // data source name. MaxOpenConn int // pool, e.g:10 MaxIdleConn int // pool, e.g:100 MaxConnTimeout xtime.Duration // connect max life time. Unmarshal config file e.g: 10s、2m、1m10s LogLevel string // enum: info、warn、error、silent, default warn Colorful bool // is colorful log, default false SlowThreshold xtime.Duration // slow sql log. Unmarshal config file e.g: 100ms、200ms、300ms、1s, default 200ms }
MySQLConfig mysql config.
Click to show internal directories.
Click to hide internal directories.