@@ -68,7 +68,7 @@ type RedisConfig struct {
68
68
Username string $json:"username"$
69
69
Passwd string $json:"passwd"$
70
70
Addr string $json:"addr"$
71
- Maxopen int $json:"max_open"$ //default 256 //max num of connections can be opened
71
+ MaxOpen int $json:"max_open"$ //default 256 //max num of connections can be opened
72
72
MaxIdletime ctime.Duration $json:"max_idletime"$ //default 1min //max time a connection can be idle,more then this time,connection will be closed
73
73
IoTimeout ctime.Duration $json:"io_timeout"$ //default 500ms
74
74
ConnTimeout ctime.Duration $json:"conn_timeout"$ //default 250ms
@@ -81,7 +81,7 @@ type DBConfig struct {
81
81
Net string $json:"net"$
82
82
Addr string $json:"addr"$
83
83
Collation string $json:"collation"$
84
- Maxopen int $json:"max_open"$ //default 256 //max num of connections can be opened
84
+ MaxOpen int $json:"max_open"$ //default 256 //max num of connections can be opened
85
85
MaxIdletime ctime.Duration $json:"max_idletime"$ //default 1min //max time a connection can be idle,more then this time,connection will be closed
86
86
IoTimeout ctime.Duration $json:"io_timeout"$ //default 500ms
87
87
ConnTimeout ctime.Duration $json:"conn_timeout"$ //default 250ms
@@ -164,8 +164,8 @@ func (c *sourceConfig) validate() {
164
164
dbc.Addr = "127.0.0.1:3306"
165
165
dbc.Net = "tcp"
166
166
}
167
- if dbc.Maxopen == 0 {
168
- dbc.Maxopen = 100
167
+ if dbc.MaxOpen == 0 {
168
+ dbc.MaxOpen = 100
169
169
}
170
170
if dbc.MaxIdletime == 0 {
171
171
dbc.MaxIdletime = ctime.Duration(time.Minute * 10)
@@ -181,8 +181,8 @@ func (c *sourceConfig) validate() {
181
181
if redisc.Addr == "" {
182
182
redisc.Addr = "127.0.0.1:6379"
183
183
}
184
- if redisc.Maxopen == 0 {
185
- redisc.Maxopen = 100
184
+ if redisc.MaxOpen == 0 {
185
+ redisc.MaxOpen = 100
186
186
}
187
187
if redisc.MaxIdletime == 0 {
188
188
redisc.MaxIdletime = ctime.Duration(time.Minute * 10)
@@ -230,9 +230,9 @@ func (c *sourceConfig) newsource() {
230
230
Addr :dbc.Addr,
231
231
Collation :dbc.Collation,
232
232
MaxOpen :dbc.MaxOpen,
233
- MaxIdletime time.Duration(dbc.MaxIdletime),
234
- IOTimeout time.Duration(dbc.IOTimeout ),
235
- ConnTimeout time.Duration(dbc.ConnTimeout)
233
+ MaxIdletime : time.Duration(dbc.MaxIdletime),
234
+ IOTimeout : time.Duration(dbc.IoTimeout ),
235
+ ConnTimeout : time.Duration(dbc.ConnTimeout),
236
236
})
237
237
}
238
238
caches = make(map[string]*redis.Pool, len(c.Redis))
@@ -244,7 +244,7 @@ func (c *sourceConfig) newsource() {
244
244
Username: redisc.Username,
245
245
Password: redisc.Passwd,
246
246
Addr: redisc.Addr,
247
- MaxOpen: redisc.Maxopen ,
247
+ MaxOpen: redisc.MaxOpen ,
248
248
MaxIdletime: time.Duration(redisc.MaxIdletime),
249
249
IOTimeout: time.Duration(redisc.IoTimeout),
250
250
ConnTimeout: time.Duration(redisc.ConnTimeout),
0 commit comments