Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // mysql sqlite3 postgres and custom Dialect string `yaml:"dialect" json:"dialect"` // dsn Dsn string `yaml:"dsn" json:"dsn"` // MaxIdleConn sets the maximum number of open connections to the database. // If n <= 0, then there is no limit on the number of open connections. // The default is 0 (unlimited). MaxIdleConn int `yaml:"maxIdleConn" json:"maxIdleConn"` // MaxOpenConn sets the maximum number of open connections to the database. // If n <= 0, then there is no limit on the number of open connections. // The default is 0 (unlimited). MaxOpenConn int `yaml:"maxOpenConn" json:"maxOpenConn"` // MaxLifetime sets the maximum amount of time a connection may be reused. // If d <= 0, connections are not closed due to a connection's age. MaxLifetime time.Duration `yaml:"maxLifetime" json:"maxLifetime"` // MaxIdleTime sets the maximum amount of time a connection may be idle. // If d <= 0, connections are not closed due to a connection's idle time. MaxIdleTime time.Duration `yaml:"maxIdleTime" json:"maxIdleTime"` // EnableLog enabled log flag use by user EnableLog bool `yaml:"enableLog" json:"enableLog"` }
Config 数据库配置
Click to show internal directories.
Click to hide internal directories.