MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / inheritFromBootstrap

Method inheritFromBootstrap

rest/config.go:428–447  ·  view source on GitHub ↗

inheritFromBootstrap sets any empty Couchbase Server values from the given bootstrap config.

(b BootstrapConfig)

Source from the content-addressed store, hash-verified

426
427// inheritFromBootstrap sets any empty Couchbase Server values from the given bootstrap config.
428func (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
449func (dbConfig *DbConfig) setDatabaseCredentials(credentials base.CredentialsConfig) {
450 // X.509 overrides username/password

Callers 1

setupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected