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