format

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDateFormat = "2006-01-02 15:04:05 MST"

Variables

View Source
var Formatters map[string]Formatter = map[string]Formatter{}

Formatters is a map of cli argument name to formatter inferface object

Functions

func FormatDate

func FormatDate(input time.Time) string

Types

type ByEndAt

type ByEndAt []types.Silence

func (ByEndAt) Len

func (s ByEndAt) Len() int

func (ByEndAt) Less

func (s ByEndAt) Less(i, j int) bool

func (ByEndAt) Swap

func (s ByEndAt) Swap(i, j int)

type ByStartsAt

type ByStartsAt []*dispatch.APIAlert

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 Config

type Config struct {
	ConfigYAML  string                 `json:"configYAML"`
	ConfigJSON  config.Config          `json:"configJSON"`
	MeshStatus  map[string]interface{} `json:"meshStatus"`
	VersionInfo map[string]string      `json:"versionInfo"`
	Uptime      time.Time              `json:"uptime"`
}

Config representation Need to get this moved to the prometheus/common/model repo having is duplicated here is smelly

type ExtendedFormatter

type ExtendedFormatter struct {
	// contains filtered or unexported fields
}

func (*ExtendedFormatter) FormatAlerts

func (formatter *ExtendedFormatter) FormatAlerts(alerts []*dispatch.APIAlert) error

func (*ExtendedFormatter) FormatConfig

func (formatter *ExtendedFormatter) FormatConfig(config Config) 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([]*dispatch.APIAlert) error
	FormatConfig(Config) 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 []*dispatch.APIAlert) error

func (*JsonFormatter) FormatConfig

func (formatter *JsonFormatter) FormatConfig(config Config) error

func (*JsonFormatter) FormatSilences

func (formatter *JsonFormatter) FormatSilences(silences []types.Silence) error

func (*JsonFormatter) SetOutput

func (formatter *JsonFormatter) SetOutput(writer io.Writer)

type MeshStatus

type MeshStatus struct {
	Name     string       `json:"name"`
	NickName string       `json:"nickName"`
	Peers    []PeerStatus `json:"peerStatus"`
}

type PeerStatus

type PeerStatus struct {
	Name     string `json:"name"`
	NickName string `json:"nickName"`
	UID      uint64 `uid`
}

type SimpleFormatter

type SimpleFormatter struct {
	// contains filtered or unexported fields
}

func (*SimpleFormatter) FormatAlerts

func (formatter *SimpleFormatter) FormatAlerts(alerts []*dispatch.APIAlert) error

func (*SimpleFormatter) FormatConfig

func (formatter *SimpleFormatter) FormatConfig(config Config) error

func (*SimpleFormatter) FormatSilences

func (formatter *SimpleFormatter) FormatSilences(silences []types.Silence) error

func (*SimpleFormatter) SetOutput

func (formatter *SimpleFormatter) SetOutput(writer io.Writer)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL