Documentation ¶
Index ¶
- Constants
- Variables
- func FormatDate(input time.Time) string
- func InitFormatFlags(app *kingpin.Application)
- type ByEndAt
- type ByStartsAt
- type ExtendedFormatter
- func (formatter *ExtendedFormatter) FormatAlerts(alerts []*client.ExtendedAlert) error
- func (formatter *ExtendedFormatter) FormatConfig(status *client.ServerStatus) error
- func (formatter *ExtendedFormatter) FormatSilences(silences []types.Silence) error
- func (formatter *ExtendedFormatter) SetOutput(writer io.Writer)
- type Formatter
- type JSONFormatter
- func (formatter *JSONFormatter) FormatAlerts(alerts []*client.ExtendedAlert) error
- func (formatter *JSONFormatter) FormatConfig(status *client.ServerStatus) error
- func (formatter *JSONFormatter) FormatSilences(silences []types.Silence) error
- func (formatter *JSONFormatter) SetOutput(writer io.Writer)
- type SimpleFormatter
- func (formatter *SimpleFormatter) FormatAlerts(alerts []*client.ExtendedAlert) error
- func (formatter *SimpleFormatter) FormatConfig(status *client.ServerStatus) error
- func (formatter *SimpleFormatter) FormatSilences(silences []types.Silence) 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 ¶ added in v0.13.0
func InitFormatFlags(app *kingpin.Application)
Types ¶
type ByStartsAt ¶
type ByStartsAt []*client.ExtendedAlert
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 []*client.ExtendedAlert) error
func (*ExtendedFormatter) FormatConfig ¶
func (formatter *ExtendedFormatter) FormatConfig(status *client.ServerStatus) error
func (*ExtendedFormatter) FormatSilences ¶
func (formatter *ExtendedFormatter) FormatSilences(silences []types.Silence) error
func (*ExtendedFormatter) SetOutput ¶
func (formatter *ExtendedFormatter) SetOutput(writer io.Writer)
type Formatter ¶
type Formatter interface { SetOutput(io.Writer) FormatSilences([]types.Silence) error FormatAlerts([]*client.ExtendedAlert) error FormatConfig(*client.ServerStatus) error }
Formatter needs to be implemented for each new output formatter.
type JSONFormatter ¶ added in v0.10.0
type JSONFormatter struct {
// contains filtered or unexported fields
}
func (*JSONFormatter) FormatAlerts ¶ added in v0.10.0
func (formatter *JSONFormatter) FormatAlerts(alerts []*client.ExtendedAlert) error
func (*JSONFormatter) FormatConfig ¶ added in v0.10.0
func (formatter *JSONFormatter) FormatConfig(status *client.ServerStatus) error
func (*JSONFormatter) FormatSilences ¶ added in v0.10.0
func (formatter *JSONFormatter) FormatSilences(silences []types.Silence) error
func (*JSONFormatter) SetOutput ¶ added in v0.10.0
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 []*client.ExtendedAlert) error
func (*SimpleFormatter) FormatConfig ¶
func (formatter *SimpleFormatter) FormatConfig(status *client.ServerStatus) error
func (*SimpleFormatter) FormatSilences ¶
func (formatter *SimpleFormatter) FormatSilences(silences []types.Silence) error
func (*SimpleFormatter) SetOutput ¶
func (formatter *SimpleFormatter) SetOutput(writer io.Writer)
Click to show internal directories.
Click to hide internal directories.