indicator

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ApplyPatches

func ApplyPatches(patches []Patch, documentBytes []byte) ([]byte, error)

func MatchDocument

func MatchDocument(criteria Match, documentBytes []byte) bool

func OverrideMetadata

func OverrideMetadata(overrideMetadata map[string]string) func(options *readOptions)

func ParseMetadata

func ParseMetadata(input string) map[string]string

func SkipMetadataInterpolation

func SkipMetadataInterpolation(options *readOptions)

func ValidateForK8s added in v0.7.11

func ValidateForK8s(document Document) []error

func ValidateForRegistry added in v0.7.11

func ValidateForRegistry(document Document) []error

func ValidateIndicator added in v0.7.11

func ValidateIndicator(i Indicator, idx int) []error

Types

type Alert

type Alert struct {
	For  string
	Step string
}

type ChartType

type ChartType string
const (
	StepChart   ChartType = "step"
	BarChart    ChartType = "bar"
	StatusChart ChartType = "status"
)

type Document

type Document struct {
	APIVersion string
	Product    Product
	Metadata   map[string]string
	Indicators []Indicator
	Layout     Layout
}

func ProcessDocument

func ProcessDocument(patches []Patch, documentBytes []byte) (Document, []error)

func ReadFile

func ReadFile(indicatorsFile string, opts ...ReadOpt) (Document, error)

func ReadIndicatorDocument

func ReadIndicatorDocument(yamlBytes []byte, opts ...ReadOpt) (Document, error)

func (Document) GetIndicator added in v0.7.11

func (document Document) GetIndicator(name string) (Indicator, bool)

func (Document) UID added in v0.7.10

func (document Document) UID() string

type Indicator

type Indicator struct {
	Name          string
	PromQL        string
	Thresholds    []Threshold
	Alert         Alert
	ServiceLevel  *ServiceLevel
	Documentation map[string]string
	Presentation  Presentation
}

type Layout

type Layout struct {
	Title       string
	Description string
	Sections    []Section
	Owner       string
}

type Match

type Match struct {
	Name     *string
	Version  *string
	Metadata map[string]string
}

type OperatorType

type OperatorType int
const (
	LessThan OperatorType = iota
	LessThanOrEqualTo
	EqualTo
	NotEqualTo
	GreaterThanOrEqualTo
	GreaterThan
	Undefined
)

func GetComparatorFromString

func GetComparatorFromString(operator string) OperatorType

type Patch

type Patch struct {
	APIVersion string
	Match      Match
	Operations []patch.OpDefinition
}

func ReadPatchBytes

func ReadPatchBytes(yamlBytes []byte) (Patch, error)

func ReadPatchFile

func ReadPatchFile(patchFile string) (Patch, error)

type Presentation

type Presentation struct {
	ChartType
	CurrentValue bool
	Frequency    int64
	Labels       []string
	Units        string
}

type Product

type Product struct {
	Name    string
	Version string
}

type ReadOpt

type ReadOpt func(options *readOptions)

type Section

type Section struct {
	Title       string
	Description string
	Indicators  []string
}

type ServiceLevel added in v0.7.11

type ServiceLevel struct {
	Objective float64
}

type Threshold

type Threshold struct {
	Level    string
	Operator OperatorType
	Value    float64
}

func (*Threshold) GetComparator

func (e *Threshold) GetComparator() string

func (*Threshold) GetComparatorAbbrev

func (e *Threshold) GetComparatorAbbrev() string

Jump to

Keyboard shortcuts

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