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

Function readLegacyServerConfig

rest/config_legacy.go:372–382  ·  view source on GitHub ↗

readLegacyServerConfig returns a validated LegacyServerConfig from an io.Reader

(ctx context.Context, r io.Reader)

Source from the content-addressed store, hash-verified

370
371// readLegacyServerConfig returns a validated LegacyServerConfig from an io.Reader
372func readLegacyServerConfig(ctx context.Context, r io.Reader) (config *LegacyServerConfig, err error) {
373 err = DecodeAndSanitiseStartupConfig(ctx, r, &config, true)
374 if err != nil {
375 return config, err
376 }
377
378 if config.Replications != nil {
379 return config, fmt.Errorf("cannot use SG replicate as it has been removed. Please use Inter-Sync Gateway Replication instead")
380 }
381 return config, err
382}
383
384// setupServerConfig parses command-line flags, reads the optional configuration file,
385// performs the config validation and database setup.

Callers 8

TestReadServerConfigFunction · 0.85
TestConfigValidationFunction · 0.85
LoadLegacyServerConfigFunction · 0.85

Calls 2

ErrorfMethod · 0.80

Tested by 7

TestReadServerConfigFunction · 0.68
TestConfigValidationFunction · 0.68