readLegacyServerConfig returns a validated LegacyServerConfig from an io.Reader
(ctx context.Context, r io.Reader)
| 370 | |
| 371 | // readLegacyServerConfig returns a validated LegacyServerConfig from an io.Reader |
| 372 | func 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. |