@@ -10,6 +10,7 @@ package mysql
10
10
11
11
import (
12
12
"bytes"
13
+ "context"
13
14
"crypto/rsa"
14
15
"crypto/tls"
15
16
"errors"
@@ -34,24 +35,25 @@ var (
34
35
// If a new Config is created instead of being parsed from a DSN string,
35
36
// the NewConfig function should be used, which sets default values.
36
37
type 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
55
57
56
58
AllowAllFiles bool // Allow all files to be used with LOAD DATA LOCAL INFILE
57
59
AllowCleartextPasswords bool // Allows the cleartext client side plugin
0 commit comments