template

package
v0.0.0-cloud Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

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