summaryrefslogtreecommitdiff
path: root/plugins/status/config.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-04-06 15:15:01 +0300
committerValery Piashchynski <[email protected]>2021-04-06 15:15:01 +0300
commitad8db0ad8907fbc562123b41323b34ec6c0dec9f (patch)
tree036884e8f37d3c9abe965e487fe2eecef903ccf2 /plugins/status/config.go
parent4e468f900e82c344269be0129624cbfcde706e26 (diff)
- Add new configuration option to the status plugin
Diffstat (limited to 'plugins/status/config.go')
-rw-r--r--plugins/status/config.go13
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
+ }
}