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

Function getInitialStartupConfig

rest/main.go:168–191  ·  view source on GitHub ↗
(fileStartupConfig *StartupConfig, flagStartupConfig *StartupConfig)

Source from the content-addressed store, hash-verified

166}
167
168func getInitialStartupConfig(fileStartupConfig *StartupConfig, flagStartupConfig *StartupConfig) (*StartupConfig, error) {
169 initialStartupConfigTemp := StartupConfig{}
170
171 if fileStartupConfig != nil {
172 if err := initialStartupConfigTemp.Merge(fileStartupConfig); err != nil {
173 return nil, err
174 }
175 }
176
177 if flagStartupConfig != nil {
178 if err := initialStartupConfigTemp.Merge(flagStartupConfig); err != nil {
179 return nil, err
180 }
181 }
182
183 // Requires a deep copy of final input as passed in values are pointers.
184 // Need to ensure runtime changes don't affect initialStartupConfig.
185 var initialStartupConfig StartupConfig
186 if err := base.DeepCopyInefficient(&initialStartupConfig, initialStartupConfigTemp); err != nil {
187 return nil, err
188 }
189
190 return &initialStartupConfig, nil
191}
192
193// automaticConfigUpgrade takes the config path of the current 2.x config and attempts to perform the update steps to
194// update it to a 3.x config

Callers 2

legacyServerMainFunction · 0.85

Calls 2

MergeMethod · 0.95
DeepCopyInefficientFunction · 0.92

Tested by

no test coverage detected