Update comments

- updates comments and adds where missing
- updates locks so that unlock is done via defer instead of
at the end of the statement
- extracts timeout variable in two places
- remove makeClient() unused method from metrics package

No-harm changes tested via go build.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2018-10-03 13:16:28 +01:00
parent 609ef28cad
commit bd39b9267a
9 changed files with 40 additions and 34 deletions

View File

@ -51,7 +51,7 @@ func parseIntOrDurationValue(val string, fallback time.Duration) time.Duration {
return duration
}
// Read fetches config from environmental variables.
// Read fetches gateway server configuration from environmental variables
func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig {
cfg := GatewayConfig{
PrometheusHost: "prometheus",
@ -117,7 +117,7 @@ func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig {
return cfg
}
// GatewayConfig for the process.
// GatewayConfig provides config for the API Gateway server process
type GatewayConfig struct {
// HTTP timeout for reading a request from clients.