Continue working on #2: Slack alerts
This commit is contained in:
		| @ -22,6 +22,7 @@ var ( | |||||||
|  |  | ||||||
| type Config struct { | type Config struct { | ||||||
| 	Metrics  bool            `yaml:"metrics"` | 	Metrics  bool            `yaml:"metrics"` | ||||||
|  | 	Alerting *core.Alerting  `yaml:"alerting"` | ||||||
| 	Services []*core.Service `yaml:"services"` | 	Services []*core.Service `yaml:"services"` | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										14
									
								
								core/alert.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								core/alert.go
									
									
									
									
									
										Normal file
									
								
							| @ -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" | ||||||
|  | ) | ||||||
							
								
								
									
										5
									
								
								core/alerting.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								core/alerting.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | package core | ||||||
|  |  | ||||||
|  | type Alerting struct { | ||||||
|  | 	Slack string `yaml:"slack"` | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user