template

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterLabelFuncName      = "filterLabels"
	FilterLabelReFuncName    = "filterLabelsRe"
	GraphLinkFuncName        = "graphLink"
	RemoveLabelsFuncName     = "removeLabels"
	RemoveLabelsReFuncName   = "removeLabelsRe"
	TableLinkFuncName        = "tableLink"
	MergeLabelValuesFuncName = "mergeLabelValues"
)

Variables

This section is empty.

Functions

func Expand

func Expand(ctx context.Context, name, tmpl string, data Data, externalURL *url.URL, evaluatedAt time.Time) (string, error)

func NewValues

func NewValues(captures map[string]eval.NumberValueCapture) map[string]Value

Types

type Data

type Data struct {
	Labels Labels
	Values map[string]Value
	Value  string
}

func NewData

func NewData(labels map[string]string, res eval.Result) Data

type ExpandError

type ExpandError struct {
	Tmpl string
	Err  error
}

ExpandError is an error containing the template and the error that occurred while expanding it.

func (ExpandError) Error

func (e ExpandError) Error() string

type Labels

type Labels map[string]string

func (Labels) String

func (l Labels) String() string

String returns the labels as k=v, comma separated, in increasing order.

type Value

type Value struct {
	Labels Labels
	Value  float64
}

Value contains the labels and value of a Reduce, Math or Threshold expression for a series.

func (Value) String

func (v Value) String() string

Jump to

Keyboard shortcuts

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