Notify implements notifier interface
(results []types.Result)
| 34 | |
| 35 | // Notify implements notifier interface |
| 36 | func (s Notifier) Notify(results []types.Result) error { |
| 37 | errs := make(types.Errors, 0) |
| 38 | for _, result := range results { |
| 39 | if !result.Healthy { |
| 40 | if err := s.Send(result); err != nil { |
| 41 | errs = append(errs, err) |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | return errs |
| 46 | } |
| 47 | |
| 48 | // Send request via Slack API to create incident |
| 49 | func (s Notifier) Send(result types.Result) error { |