diff options
author | Valery Piashchynski <[email protected]> | 2021-04-06 15:15:01 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-04-06 15:15:01 +0300 |
commit | ad8db0ad8907fbc562123b41323b34ec6c0dec9f (patch) | |
tree | 036884e8f37d3c9abe965e487fe2eecef903ccf2 /plugins/status/config.go | |
parent | 4e468f900e82c344269be0129624cbfcde706e26 (diff) |
- Add new configuration option to the status plugin
Diffstat (limited to 'plugins/status/config.go')
-rw-r--r-- | plugins/status/config.go | 13 |
1 files changed, 13 insertions, 0 deletions
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 + } } |