From 6596d253aa62004c0256ff6f6fe7f0a508133b35 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Wed, 19 Aug 2020 19:41:01 -0400 Subject: [PATCH] Continue working on #2: Slack alerts --- config/config.go | 1 + core/alert.go | 14 ++++++++++++++ core/alerting.go | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 core/alert.go create mode 100644 core/alerting.go diff --git a/config/config.go b/config/config.go index 08152b68..2a714232 100644 --- a/config/config.go +++ b/config/config.go @@ -22,6 +22,7 @@ var ( type Config struct { Metrics bool `yaml:"metrics"` + Alerting *core.Alerting `yaml:"alerting"` Services []*core.Service `yaml:"services"` } diff --git a/core/alert.go b/core/alert.go new file mode 100644 index 00000000..1750a926 --- /dev/null +++ b/core/alert.go @@ -0,0 +1,14 @@ +package core + +type Alert struct { + Type AlertType `yaml:"type"` + Enabled bool `yaml:"enabled"` + Threshold int `yaml:"threshold"` + Description string `yaml:"description"` +} + +type AlertType string + +const ( + SlackAlert AlertType = "slack" +) diff --git a/core/alerting.go b/core/alerting.go new file mode 100644 index 00000000..bfba579e --- /dev/null +++ b/core/alerting.go @@ -0,0 +1,5 @@ +package core + +type Alerting struct { + Slack string `yaml:"slack"` +}