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

Method ToDatabaseConfig

rest/config_legacy.go:294–314  ·  view source on GitHub ↗

ToDatabaseConfig "upgrades" a DbConfig to be compatible with 3.x

()

Source from the content-addressed store, hash-verified

292
293// ToDatabaseConfig "upgrades" a DbConfig to be compatible with 3.x
294func (dbc *DbConfig) ToDatabaseConfig() *DatabaseConfig {
295 if dbc == nil {
296 return nil
297 }
298
299 // Backwards compatibility: Continue defaulting to xattrs=false for upgraded 2.x configs (3.0+ default xattrs=true)
300 if dbc.EnableXattrs == nil {
301 dbc.EnableXattrs = base.Ptr(false)
302 }
303
304 // Move guest out of the Users section and into its own promoted field
305 if guest, ok := dbc.Users[base.GuestUsername]; ok {
306 dbc.Guest = guest
307 delete(dbc.Users, base.GuestUsername)
308 }
309
310 return &DatabaseConfig{
311 cfgCas: 0,
312 DbConfig: *dbc,
313 }
314}
315
316func legacyServerAddressUpgrade(server string) (newServer, username, password string, err error) {
317 if base.ServerIsWalrus(server) {

Calls 1

PtrFunction · 0.92