File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 3030 database : ' '
3131 username : ' '
3232 password : ' '
33+ auth-source : ' '
3334 min-pool-size : 0
3435 max-pool-size : 100
3536 socket-timeout-ms : 0
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ type Mongo struct {
1111 Database string `json:"database" yaml:"database" mapstructure:"database"` // database name
1212 Username string `json:"username" yaml:"username" mapstructure:"username"` // 用户名
1313 Password string `json:"password" yaml:"password" mapstructure:"password"` // 密码
14+ AuthSource string `json:"auth-source" yaml:"auth-source" mapstructure:"auth-source"` // 验证数据库
1415 MinPoolSize uint64 `json:"min-pool-size" yaml:"min-pool-size" mapstructure:"min-pool-size"` // 最小连接池
1516 MaxPoolSize uint64 `json:"max-pool-size" yaml:"max-pool-size" mapstructure:"max-pool-size"` // 最大连接池
1617 SocketTimeoutMs int64 `json:"socket-timeout-ms" yaml:"socket-timeout-ms" mapstructure:"socket-timeout-ms"` // socket超时时间
Original file line number Diff line number Diff line change @@ -54,8 +54,9 @@ func (m *mongo) Initialization() error {
5454 SocketTimeoutMS : & global .GVA_CONFIG .Mongo .SocketTimeoutMs ,
5555 ConnectTimeoutMS : & global .GVA_CONFIG .Mongo .ConnectTimeoutMs ,
5656 Auth : & qmgo.Credential {
57- Username : global .GVA_CONFIG .Mongo .Username ,
58- Password : global .GVA_CONFIG .Mongo .Password ,
57+ Username : global .GVA_CONFIG .Mongo .Username ,
58+ Password : global .GVA_CONFIG .Mongo .Password ,
59+ AuthSource : global .GVA_CONFIG .Mongo .AuthSource ,
5960 },
6061 }, opts ... )
6162 if err != nil {
You can’t perform that action at this time.
0 commit comments