@@ -35,24 +35,25 @@ var (
35
35
// If a new Config is created instead of being parsed from a DSN string,
36
36
// the NewConfig function should be used, which sets default values.
37
37
type Config struct {
38
- User string // Username
39
- Passwd string // Password (requires User)
40
- Net string // Network (e.g. "tcp", "tcp6", "unix". default: "tcp")
41
- Addr string // Address (default: "127.0.0.1:3306" for "tcp" and "/tmp/mysql.sock" for "unix")
42
- DBName string // Database name
43
- Params map [string ]string // Connection parameters
44
- ConnectionAttributes string // Connection Attributes, comma-delimited string of user-defined "key:value" pairs
45
- Collation string // Connection collation
46
- Loc * time.Location // Location for time.Time values
47
- MaxAllowedPacket int // Max packet size allowed
48
- ServerPubKey string // Server public key name
49
- pubKey * rsa.PublicKey // Server public key
50
- TLSConfig string // TLS configuration name
51
- TLS * tls.Config // TLS configuration, its priority is higher than TLSConfig
52
- Timeout time.Duration // Dial timeout
53
- ReadTimeout time.Duration // I/O read timeout
54
- WriteTimeout time.Duration // I/O write timeout
55
- Logger Logger // Logger
38
+ User string // Username
39
+ Passwd string // Password (requires User)
40
+ Net string // Network (e.g. "tcp", "tcp6", "unix". default: "tcp")
41
+ Addr string // Address (default: "127.0.0.1:3306" for "tcp" and "/tmp/mysql.sock" for "unix")
42
+ DBName string // Database name
43
+ Params map [string ]string // Connection parameters
44
+ ConnectionAttributes string // Connection Attributes, comma-delimited string of user-defined "key:value" pairs
45
+ Collation string // Connection collation
46
+ Loc * time.Location // Location for time.Time values
47
+ MaxAllowedPacket int // Max packet size allowed
48
+ ServerPubKey string // Server public key name
49
+ pubKey * rsa.PublicKey // Server public key
50
+ TLSConfig string // TLS configuration name
51
+ TLS * tls.Config // TLS configuration, its priority is higher than TLSConfig
52
+ Timeout time.Duration // Dial timeout
53
+ ReadTimeout time.Duration // I/O read timeout
54
+ WriteTimeout time.Duration // I/O write timeout
55
+ Logger Logger // Logger
56
+ BeforeConnect func (context.Context , * Config ) error // Invoked before a connection is established
56
57
57
58
AllowAllFiles bool // Allow all files to be used with LOAD DATA LOCAL INFILE
58
59
AllowCleartextPasswords bool // Allows the cleartext client side plugin
@@ -66,8 +67,6 @@ type Config struct {
66
67
MultiStatements bool // Allow multiple statements in one query
67
68
ParseTime bool // Parse time values to time.Time
68
69
RejectReadOnly bool // Reject read-only connections
69
-
70
- BeforeConnect func (context.Context , * Config ) error // Invoked before a connection is established
71
70
}
72
71
73
72
// NewConfig creates a new Config and sets default values.
0 commit comments