inheritFromBootstrap sets any empty Couchbase Server values from the given bootstrap config.
(b BootstrapConfig)
| 426 | |
| 427 | // inheritFromBootstrap sets any empty Couchbase Server values from the given bootstrap config. |
| 428 | func (dbc *DbConfig) inheritFromBootstrap(b BootstrapConfig) { |
| 429 | if dbc.Username == "" { |
| 430 | dbc.Username = b.Username |
| 431 | } |
| 432 | if dbc.Password == "" { |
| 433 | dbc.Password = b.Password |
| 434 | } |
| 435 | if dbc.CACertPath == "" { |
| 436 | dbc.CACertPath = b.CACertPath |
| 437 | } |
| 438 | if dbc.CertPath == "" { |
| 439 | dbc.CertPath = b.X509CertPath |
| 440 | } |
| 441 | if dbc.KeyPath == "" { |
| 442 | dbc.KeyPath = b.X509KeyPath |
| 443 | } |
| 444 | if dbc.Server == nil || *dbc.Server == "" { |
| 445 | dbc.Server = &b.Server |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | func (dbConfig *DbConfig) setDatabaseCredentials(credentials base.CredentialsConfig) { |
| 450 | // X.509 overrides username/password |