decoder

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAlertValueFunc = fmt.Errorf("invalid alert value function")
View Source
var ErrInvalidColoringTarget = fmt.Errorf("invalid coloring target")
View Source
var ErrInvalidSingleStatValueType = fmt.Errorf("invalid single stat value type")
View Source
var ErrInvalidSparkLineMode = fmt.Errorf("invalid sparkline mode")
View Source
var ErrNoAlertThresholdDefined = fmt.Errorf("no threshold defined")
View Source
var ErrPanelNotConfigured = fmt.Errorf("panel not configured")
View Source
var ErrTargetNotConfigured = fmt.Errorf("target not configured")
View Source
var ErrVariableNotConfigured = fmt.Errorf("variable not configured")

Functions

func UnmarshalYAML

func UnmarshalYAML(input io.Reader) (builder.Builder, error)

Types

type AlertCondition added in v0.6.0

type AlertCondition struct {
	Operand   string
	Value     AlertValue
	Threshold AlertThreshold
}

type AlertThreshold added in v0.6.0

type AlertThreshold struct {
	HasNoValue   bool `yaml:"has_no_value"`
	Above        *float64
	Below        *float64
	OutsideRange [2]float64 `yaml:"outside_range"`
	WithinRange  [2]float64 `yaml:"within_range"`
}

type AlertValue added in v0.6.0

type AlertValue struct {
	Func     string
	QueryRef string `yaml:"ref"`
	From     string
	To       string
}

type DashboardGraph added in v0.6.0

type DashboardGraph struct {
	Title      string
	Span       float32 `yaml:",omitempty"`
	Height     string  `yaml:",omitempty"`
	Datasource string  `yaml:",omitempty"`
	Targets    []Target
	Axes       *GraphAxes  `yaml:",omitempty"`
	Alert      *GraphAlert `yaml:",omitempty"`
}

type DashboardModel added in v0.6.0

type DashboardModel struct {
	Title           string
	Editable        bool
	SharedCrosshair bool `yaml:"shared_crosshair"`
	Tags            []string
	AutoRefresh     string `yaml:"auto_refresh"`

	TagsAnnotation []dashboard.TagAnnotation `yaml:"tags_annotations"`
	Variables      []DashboardVariable

	Rows []DashboardRow
}

type DashboardPanel added in v0.6.0

type DashboardPanel struct {
	Graph      *DashboardGraph      `yaml:",omitempty"`
	Table      *DashboardTable      `yaml:",omitempty"`
	SingleStat *DashboardSingleStat `yaml:"single_stat,omitempty"`
	Text       *DashboardText       `yaml:",omitempty"`
}

type DashboardRow added in v0.6.0

type DashboardRow struct {
	Name   string
	Panels []DashboardPanel
}

type DashboardSingleStat added in v0.6.0

type DashboardSingleStat struct {
	Title      string
	Span       float32 `yaml:",omitempty"`
	Height     string  `yaml:",omitempty"`
	Datasource string  `yaml:",omitempty"`
	Unit       string
	ValueType  string `yaml:"value_type"`
	SparkLine  string `yaml:"sparkline"`
	Targets    []Target
	Thresholds [2]string
	Colors     [3]string
	Color      []string `yaml:",omitempty"`
}

type DashboardTable added in v0.6.0

type DashboardTable struct {
	Title                  string
	Span                   float32 `yaml:",omitempty"`
	Height                 string  `yaml:",omitempty"`
	Datasource             string  `yaml:",omitempty"`
	Targets                []Target
	HiddenColumns          []string            `yaml:"hidden_columns"`
	TimeSeriesAggregations []table.Aggregation `yaml:"time_series_aggregations"`
}

type DashboardText added in v0.6.0

type DashboardText struct {
	Title    string
	Span     float32 `yaml:",omitempty"`
	Height   string  `yaml:",omitempty"`
	HTML     string  `yaml:",omitempty"`
	Markdown string  `yaml:",omitempty"`
}

type DashboardVariable added in v0.6.0

type DashboardVariable struct {
	Interval *VariableInterval `yaml:",omitempty"`
	Custom   *VariableCustom   `yaml:",omitempty"`
	Query    *VariableQuery    `yaml:",omitempty"`
	Const    *VariableConst    `yaml:",omitempty"`
}

type GraphAlert added in v0.6.0

type GraphAlert struct {
	Title            string
	EvaluateEvery    string `yaml:"evaluate_every"`
	For              string
	If               []AlertCondition
	Notify           *int64
	Message          string
	OnNoData         string `yaml:"on_no_data"`
	OnExecutionError string `yaml:"on_execution_error"`
}

type GraphAxes added in v0.6.0

type GraphAxes struct {
	Left   *GraphAxis
	Right  *GraphAxis
	Bottom *GraphAxis
}

type GraphAxis added in v0.6.0

type GraphAxis struct {
	Hidden  *bool
	Label   string
	Unit    *string
	Min     *float64
	Max     *float64
	LogBase int `yaml:"log_base"`
}

type PrometheusTarget added in v0.6.0

type PrometheusTarget struct {
	Query  string
	Legend string `yaml:",omitempty"`
	Ref    string `yaml:",omitempty"`
}

type Target added in v0.6.0

type Target struct {
	Prometheus *PrometheusTarget
}

type VariableConst added in v0.6.0

type VariableConst struct {
	Name      string
	Label     string
	Default   string
	ValuesMap map[string]string `yaml:"values_map"`
}

type VariableCustom added in v0.6.0

type VariableCustom struct {
	Name      string
	Label     string
	Default   string
	ValuesMap map[string]string `yaml:"values_map"`
}

type VariableInterval added in v0.6.0

type VariableInterval struct {
	Name    string
	Label   string
	Default string
	Values  []string `yaml:",flow"`
}

type VariableQuery added in v0.6.0

type VariableQuery struct {
	Name  string
	Label string

	Datasource string
	Request    string

	IncludeAll bool `yaml:"include_all"`
	DefaultAll bool `yaml:"default_all"`
}

Jump to

Keyboard shortcuts

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