MCPcopy
hub / github.com/perkeep/perkeep / detectConfigChange

Function detectConfigChange

pkg/serverinit/serverinit.go:467–474  ·  view source on GitHub ↗

detectConfigChange returns an informative error if conf contains obsolete keys.

(conf jsonconfig.Obj)

Source from the content-addressed store, hash-verified

465
466// detectConfigChange returns an informative error if conf contains obsolete keys.
467func 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"

Callers 1

loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected