mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-07 14:29:44 +00:00
3aab66ec3a
* Implement alertmanager cli tool 'amtool' The primary goal of an alertmanager tool is to provide a cli interface for the prometheus alertmanager. My vision for this tool has two parts: - Silence management (query, add, delete) - Alert management (query, maybe more in future?) Resolves: #567
19 lines
601 B
Go
19 lines
601 B
Go
package format
|
|
|
|
import (
|
|
"github.com/prometheus/alertmanager/dispatch"
|
|
"github.com/prometheus/alertmanager/types"
|
|
)
|
|
|
|
type ByEndAt []types.Silence
|
|
|
|
func (s ByEndAt) Len() int { return len(s) }
|
|
func (s ByEndAt) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
func (s ByEndAt) Less(i, j int) bool { return s[i].EndsAt.Before(s[j].EndsAt) }
|
|
|
|
type ByStartsAt []*dispatch.APIAlert
|
|
|
|
func (s ByStartsAt) Len() int { return len(s) }
|
|
func (s ByStartsAt) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
func (s ByStartsAt) Less(i, j int) bool { return s[i].StartsAt.Before(s[j].StartsAt) }
|