NewConfig creates a new Config and sets default values.
()
| 90 | |
| 91 | // NewConfig creates a new Config and sets default values. |
| 92 | func NewConfig() *Config { |
| 93 | cfg := &Config{ |
| 94 | Loc: time.UTC, |
| 95 | MaxAllowedPacket: defaultMaxAllowedPacket, |
| 96 | Logger: defaultLogger, |
| 97 | AllowNativePasswords: true, |
| 98 | CheckConnLiveness: true, |
| 99 | } |
| 100 | return cfg |
| 101 | } |
| 102 | |
| 103 | // Apply applies the given options to the Config object. |
| 104 | func (c *Config) Apply(opts ...Option) error { |
no outgoing calls