From ad8db0ad8907fbc562123b41323b34ec6c0dec9f Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 6 Apr 2021 15:15:01 +0300 Subject: - Add new configuration option to the status plugin --- plugins/status/config.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'plugins/status/config.go') diff --git a/plugins/status/config.go b/plugins/status/config.go index 23a6ede2..f751898b 100644 --- a/plugins/status/config.go +++ b/plugins/status/config.go @@ -1,5 +1,18 @@ package status +import "net/http" + +// Config is the configuration reference for the Status plugin type Config struct { + // Address of the http server Address string + // Status code returned in case of fail, 503 by default + UnavailableStatusCode int `mapstructure:"unavailable_status_code"` +} + +// InitDefaults configuration options +func (c *Config) InitDefaults() { + if c.UnavailableStatusCode == 0 { + c.UnavailableStatusCode = http.StatusServiceUnavailable + } } -- cgit v1.2.3