We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6065f07 commit 39b1cfbCopy full SHA for 39b1cfb
mongo/db.go
@@ -24,13 +24,15 @@ type Config struct {
24
TLS *nftls.Config `mapstructure:"tls_conf"`
25
DB string `mapstructure:"db"`
26
Servers []string `mapstructure:"servers"`
27
+ ReplSetName string `mapstructure:"replset_name"`
28
ConnTimeout int64 `mapstructure:"conn_timeout"`
29
}
30
31
func Connect(config *Config, log *logrus.Entry) (*mgo.Database, error) {
32
info := &mgo.DialInfo{
- Addrs: config.Servers,
33
- Timeout: time.Second * time.Duration(config.ConnTimeout),
+ Addrs: config.Servers,
34
+ ReplicaSetName: config.ReplSetName,
35
+ Timeout: time.Second * time.Duration(config.ConnTimeout),
36
37
38
if config.TLS != nil {
0 commit comments