@@ -10,6 +10,7 @@ package mysql
1010
1111import (
1212 "bytes"
13+ "context"
1314 "crypto/rsa"
1415 "crypto/tls"
1516 "errors"
@@ -34,24 +35,25 @@ var (
3435// If a new Config is created instead of being parsed from a DSN string,
3536// the NewConfig function should be used, which sets default values.
3637type Config struct {
37- User string // Username
38- Passwd string // Password (requires User)
39- Net string // Network (e.g. "tcp", "tcp6", "unix". default: "tcp")
40- Addr string // Address (default: "127.0.0.1:3306" for "tcp" and "/tmp/mysql.sock" for "unix")
41- DBName string // Database name
42- Params map [string ]string // Connection parameters
43- ConnectionAttributes string // Connection Attributes, comma-delimited string of user-defined "key:value" pairs
44- Collation string // Connection collation
45- Loc * time.Location // Location for time.Time values
46- MaxAllowedPacket int // Max packet size allowed
47- ServerPubKey string // Server public key name
48- pubKey * rsa.PublicKey // Server public key
49- TLSConfig string // TLS configuration name
50- TLS * tls.Config // TLS configuration, its priority is higher than TLSConfig
51- Timeout time.Duration // Dial timeout
52- ReadTimeout time.Duration // I/O read timeout
53- WriteTimeout time.Duration // I/O write timeout
54- 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+ DialFunc func (ctx context.Context , network , addr string ) (net.Conn , error ) // Specifies the dial function for creating connections
5557
5658 AllowAllFiles bool // Allow all files to be used with LOAD DATA LOCAL INFILE
5759 AllowCleartextPasswords bool // Allows the cleartext client side plugin
0 commit comments