const DefaultDateFormat = "2006-01-02 15:04:05 MST"
Formatters is a map of cli argument names to formatter interface object.
var Formatters = map[string]Formatter{}
func FormatDate(input strfmt.DateTime) string
func InitFormatFlags(app *kingpin.Application)
type ByAddress []*models.PeerStatus
func (s ByAddress) Len() int
func (s ByAddress) Less(i, j int) bool
func (s ByAddress) Swap(i, j int)
type ByEndAt []models.GettableSilence
func (s ByEndAt) Len() int
func (s ByEndAt) Less(i, j int) bool
func (s ByEndAt) Swap(i, j int)
type ByStartsAt []*models.GettableAlert
func (s ByStartsAt) Len() int
func (s ByStartsAt) Less(i, j int) bool
func (s ByStartsAt) Swap(i, j int)
type ExtendedFormatter struct {
// contains filtered or unexported fields
}
func (formatter *ExtendedFormatter) FormatAlerts(alerts []*models.GettableAlert) error
FormatAlerts formats the alerts into a readable string
func (formatter *ExtendedFormatter) FormatClusterStatus(status *models.ClusterStatus) error
FormatClusterStatus formats the cluster status with peers into a readable string.
func (formatter *ExtendedFormatter) FormatConfig(status *models.AlertmanagerStatus) error
FormatConfig formats the alertmanager status information into a readable string
func (formatter *ExtendedFormatter) FormatSilences(silences []models.GettableSilence) error
FormatSilences formats the silences into a readable string
func (formatter *ExtendedFormatter) SetOutput(writer io.Writer)
Formatter needs to be implemented for each new output formatter.
type Formatter interface { SetOutput(io.Writer) FormatSilences([]models.GettableSilence) error FormatAlerts([]*models.GettableAlert) error FormatConfig(*models.AlertmanagerStatus) error FormatClusterStatus(status *models.ClusterStatus) error }
type JSONFormatter struct {
// contains filtered or unexported fields
}
func (formatter *JSONFormatter) FormatAlerts(alerts []*models.GettableAlert) error
func (formatter *JSONFormatter) FormatClusterStatus(status *models.ClusterStatus) error
func (formatter *JSONFormatter) FormatConfig(status *models.AlertmanagerStatus) error
func (formatter *JSONFormatter) FormatSilences(silences []models.GettableSilence) error
func (formatter *JSONFormatter) SetOutput(writer io.Writer)
type SimpleFormatter struct {
// contains filtered or unexported fields
}
func (formatter *SimpleFormatter) FormatAlerts(alerts []*models.GettableAlert) error
func (formatter *SimpleFormatter) FormatClusterStatus(status *models.ClusterStatus) error
func (formatter *SimpleFormatter) FormatConfig(status *models.AlertmanagerStatus) error
func (formatter *SimpleFormatter) FormatSilences(silences []models.GettableSilence) error
func (formatter *SimpleFormatter) SetOutput(writer io.Writer)