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

Function LoadLegacyServerConfig

rest/config_legacy.go:361–369  ·  view source on GitHub ↗

LoadLegacyServerConfig loads a LegacyServerConfig from either a JSON file or from a URL

(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

359
360// LoadLegacyServerConfig loads a LegacyServerConfig from either a JSON file or from a URL
361func LoadLegacyServerConfig(ctx context.Context, path string) (config *LegacyServerConfig, err error) {
362 rc, err := readFromPath(ctx, path, false)
363 if err != nil {
364 return nil, err
365 }
366
367 defer func() { _ = rc.Close() }()
368 return readLegacyServerConfig(ctx, rc)
369}
370
371// readLegacyServerConfig returns a validated LegacyServerConfig from an io.Reader
372func readLegacyServerConfig(ctx context.Context, r io.Reader) (config *LegacyServerConfig, err error) {

Callers 3

ParseCommandLineFunction · 0.85
automaticConfigUpgradeFunction · 0.85

Calls 3

readFromPathFunction · 0.85
readLegacyServerConfigFunction · 0.85
CloseMethod · 0.65

Tested by 1