2017-04-20 09:04:17 +00:00
|
|
|
package format
|
|
|
|
|
|
|
|
import (
|
2018-04-11 09:17:41 +00:00
|
|
|
"github.com/prometheus/alertmanager/client"
|
2017-04-20 09:04:17 +00:00
|
|
|
"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) }
|
|
|
|
|
2018-04-11 09:17:41 +00:00
|
|
|
type ByStartsAt []*client.ExtendedAlert
|
2017-04-20 09:04:17 +00:00
|
|
|
|
|
|
|
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) }
|