LoadLegacyServerConfig loads a LegacyServerConfig from either a JSON file or from a URL
(ctx context.Context, path string)
| 359 | |
| 360 | // LoadLegacyServerConfig loads a LegacyServerConfig from either a JSON file or from a URL |
| 361 | func 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 |
| 372 | func readLegacyServerConfig(ctx context.Context, r io.Reader) (config *LegacyServerConfig, err error) { |