Validate configuration after loading

Review Request #10006 — Created June 7, 2018 and submitted — Latest diff uploaded

Information

rb-gateway
master
94943fd...

Reviewers

We now validate the parsed config.json and check for any omitted
fields. Go doesn't let us error on a missing field during
json.Unmarshall so we have to check for its 0 value (e.g., "" for
strings). We now return an error if any required field is missing. In
the case of a missing Port field, we default to 8888 and log a warning
message.

Additionally, all files specfied in config.json are resolve relative
to the path of the config file unless they are absolute paths.

Testing done:
Ran go fmt ./....
Ran go test ./....

    Loading...