detectConfigChange returns an informative error if conf contains obsolete keys.
(conf jsonconfig.Obj)
| 465 | |
| 466 | // detectConfigChange returns an informative error if conf contains obsolete keys. |
| 467 | func detectConfigChange(conf jsonconfig.Obj) error { |
| 468 | oldHTTPSKey, oldHTTPSCert := conf.OptionalString("HTTPSKeyFile", ""), conf.OptionalString("HTTPSCertFile", "") |
| 469 | if oldHTTPSKey != "" || oldHTTPSCert != "" { |
| 470 | return fmt.Errorf("config keys %q and %q have respectively been renamed to %q and %q, please fix your server config", |
| 471 | "HTTPSKeyFile", "HTTPSCertFile", "httpsKey", "httpsCert") |
| 472 | } |
| 473 | return nil |
| 474 | } |
| 475 | |
| 476 | // LoadFile returns a low-level "handler config" from the provided filename. |
| 477 | // If the config file doesn't contain a top-level JSON key of "handlerConfig" |