matrix

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	parser.Expr
	InternalMatrix  *parser.MatrixSelector
	RangeAsVariable string
}

func New

func New(v *parser.VectorSelector, options ...Option) *Builder

func (*Builder) Children added in v0.2.0

func (b *Builder) Children() []parser.Node

func (*Builder) PositionRange

func (b *Builder) PositionRange() posrange.PositionRange

func (*Builder) Pretty

func (b *Builder) Pretty(level int) string

func (*Builder) PromQLExpr

func (b *Builder) PromQLExpr()

PromQLExpr ensures that no other types accidentally implement the interface.

func (*Builder) String

func (b *Builder) String() string

String representation of the node that returns the given node when parsed as part of a valid query.

func (*Builder) Type

func (b *Builder) Type() parser.ValueType

Type returns the type the expression evaluates to. It does not perform in-depth checks as this is done at parsing-time.

type Option

type Option func(matrix *Builder)

func WithRange

func WithRange(d time.Duration) Option

func WithRangeAsString

func WithRangeAsString(d string) Option

WithRangeAsString sets the range as a string like "3h2m1s".

func WithRangeAsVariable

func WithRangeAsVariable(name string) Option

WithRangeAsVariable sets the range as a variable name. It will be useful in case you are writing a query for a dashboard and the range is a variable like "$__rate_interval". Use it if your range is not correct in terms of PromQL syntax.

Jump to

Keyboard shortcuts

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