Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultParams = map[string]string{
"charset": "utf8mb4",
"parseTime": "True",
"loc": "Local",
}
Functions ¶
This section is empty.
Types ¶
type DefaultDns ¶
给NewDefaultMysqlDsn调用者提供一个默认的dsn struct,便于conf读取
type MysqlDSN ¶
type MysqlDSN struct { Dsn string Type string //Deprecated Username string Password string Protocol string Address string Database string Params map[string]string }
func NewDefaultMysqlDsn ¶
func NewDefaultMysqlDsn(params map[string]string, ops ...MysqlDsnOptionFunc) *MysqlDSN
func ParseMysqlDSN ¶
Turns a MysqlDSN string into a parsed MysqlDSN struct.
type MysqlDsnOptionFunc ¶
type MysqlDsnOptionFunc func(dsn *MysqlDSN)
func WithAddress ¶
func WithAddress(addr string) MysqlDsnOptionFunc
func WithAuth ¶
func WithAuth(u string, pswd string) MysqlDsnOptionFunc
func WithDatabase ¶
func WithDatabase(dbname string) MysqlDsnOptionFunc
Click to show internal directories.
Click to hide internal directories.