SeverityRank maps severities for route filtering (higher = more urgent).
(s string)
| 4 | |
| 5 | // SeverityRank maps severities for route filtering (higher = more urgent). |
| 6 | func SeverityRank(s string) int { |
| 7 | switch strings.ToLower(strings.TrimSpace(s)) { |
| 8 | case "critical": |
| 9 | return 4 |
| 10 | case "error": |
| 11 | return 3 |
| 12 | case "warning", "warn": |
| 13 | return 2 |
| 14 | case "informational", "info", "": |
| 15 | return 1 |
| 16 | default: |
| 17 | return 1 |
| 18 | } |
| 19 | } |