Documentation
¶
Index ¶
- func Abs(vector parser.Expr) *parser.Call
- func Absent(vector parser.Expr) *parser.Call
- func AbsentOverTime[T RangeVectorBuilder](input T) *parser.Call
- func Acos(vector parser.Expr) *parser.Call
- func Acosh(vector parser.Expr) *parser.Call
- func Asin(vector parser.Expr) *parser.Call
- func Asinh(vector parser.Expr) *parser.Call
- func Atan(vector parser.Expr) *parser.Call
- func Atanh(vector parser.Expr) *parser.Call
- func AvgOverTime[T RangeVectorBuilder](input T) *parser.Call
- func Ceil(vector parser.Expr) *parser.Call
- func Changes[T RangeVectorBuilder](input T) *parser.Call
- func Children(node parser.Node) []parser.Node
- func Clamp(vector parser.Expr, min float64, max float64) *parser.Call
- func ClampMax(vector parser.Expr, max float64) *parser.Call
- func ClampMin(vector parser.Expr, min float64) *parser.Call
- func Cos(vector parser.Expr) *parser.Call
- func Cosh(vector parser.Expr) *parser.Call
- func CountOverTime[T RangeVectorBuilder](input T) *parser.Call
- func DaysInMonth(vector parser.Expr) *parser.Call
- func DaysOfMonth(vector parser.Expr) *parser.Call
- func DaysOfWeek(vector parser.Expr) *parser.Call
- func DaysOfYear(vector parser.Expr) *parser.Call
- func DeepCopyExpr(expr parser.Expr) parser.Expr
- func Deg(vector parser.Expr) *parser.Call
- func Delta[T RangeVectorBuilder](input T) *parser.Call
- func Deriv[T RangeVectorBuilder](input T) *parser.Call
- func DoubleExponentialSmoothing[T RangeVectorBuilder](input T, smoothingFactor float64, trendFactor float64) *parser.Call
- func Exp(vector parser.Expr) *parser.Call
- func Floor(vector parser.Expr) *parser.Call
- func HistogramAvg(vector parser.Expr) *parser.Call
- func HistogramCount(vector parser.Expr) *parser.Call
- func HistogramFraction(lower float64, upper float64, vector parser.Expr) *parser.Call
- func HistogramQuantile(quantile float64, vector parser.Expr) *parser.Call
- func HistogramStddev(vector parser.Expr) *parser.Call
- func HistogramStdvar(vector parser.Expr) *parser.Call
- func HistogramSum(vector parser.Expr) *parser.Call
- func Hour(vector parser.Expr) *parser.Call
- func IDelta[T RangeVectorBuilder](input T) *parser.Call
- func IRate[T RangeVectorBuilder](input T) *parser.Call
- func Increase[T RangeVectorBuilder](input T) *parser.Call
- func Info(vector parser.Expr, dataLabelSelector parser.Expr) *parser.Call
- func Inspect(node parser.Node, f inspector)
- func LabelJoin(vector parser.Expr, destinationLabel string, replacement string, ...) *parser.Call
- func LabelReplace(vector parser.Expr, destinationLabel string, replacement string, ...) *parser.Call
- func LastOverTime[T RangeVectorBuilder](input T) *parser.Call
- func Ln(vector parser.Expr) *parser.Call
- func Log2(vector parser.Expr) *parser.Call
- func Log10(vector parser.Expr) *parser.Call
- func MadOverTime[T RangeVectorBuilder](input T) *parser.Call
- func MaxOverTime[T RangeVectorBuilder](input T) *parser.Call
- func MinOverTime[T RangeVectorBuilder](input T) *parser.Call
- func Minute(vector parser.Expr) *parser.Call
- func Month(vector parser.Expr) *parser.Call
- func NewNumber(num float64) *parser.NumberLiteral
- func NewString(s string) *parser.StringLiteral
- func PI() *parser.Call
- func PredictLinear[T RangeVectorBuilder](input T, t float64) *parser.Call
- func PresentOverTime[T RangeVectorBuilder](input T) *parser.Call
- func QuantileOverTime[T RangeVectorBuilder](t float64, input T) *parser.Call
- func Rad(vector parser.Expr) *parser.Call
- func Rate[T RangeVectorBuilder](input T) *parser.Call
- func Resets[T RangeVectorBuilder](input T) *parser.Call
- func Round(vector parser.Expr, t float64) *parser.Call
- func Scalar(vector parser.Expr) *parser.Call
- func Sgn(vector parser.Expr) *parser.Call
- func Sin(vector parser.Expr) *parser.Call
- func Sinh(vector parser.Expr) *parser.Call
- func Sort(vector parser.Expr) *parser.Call
- func SortByLabel(vector parser.Expr, labels ...string) *parser.Call
- func SortByLabelDesc(vector parser.Expr, labels ...string) *parser.Call
- func SortDesc(vector parser.Expr) *parser.Call
- func Sqrt(vector parser.Expr) *parser.Call
- func StddevOverTime[T RangeVectorBuilder](input T) *parser.Call
- func StdvarOverTime[T RangeVectorBuilder](input T) *parser.Call
- func SumOverTime[T RangeVectorBuilder](input T) *parser.Call
- func Tan(vector parser.Expr) *parser.Call
- func Tanh(vector parser.Expr) *parser.Call
- func Time() *parser.Call
- func Timestamp(vector parser.Expr) *parser.Call
- func Vector(scalar float64) *parser.Call
- func Walk(v parser.Visitor, node parser.Node, path []parser.Node) error
- func Year(vector parser.Expr) *parser.Call
- type AggregationBuilder
- func Avg(vector parser.Expr) *AggregationBuilder
- func BottomK(vector parser.Expr, k float64) *AggregationBuilder
- func Count(vector parser.Expr) *AggregationBuilder
- func CountValues(vector parser.Expr) *AggregationBuilder
- func Group(vector parser.Expr) *AggregationBuilder
- func LimitK(vector parser.Expr, k float64) *AggregationBuilder
- func LimitRatio(vector parser.Expr, ratio float64) *AggregationBuilder
- func Max(vector parser.Expr) *AggregationBuilder
- func Min(vector parser.Expr) *AggregationBuilder
- func Quantile(vector parser.Expr, quantile float64) *AggregationBuilder
- func Stddev(vector parser.Expr) *AggregationBuilder
- func Stdvar(vector parser.Expr) *AggregationBuilder
- func Sum(vector parser.Expr) *AggregationBuilder
- func TopK(vector parser.Expr, k float64) *AggregationBuilder
- func (a *AggregationBuilder) By(labels ...string) *AggregationBuilder
- func (a *AggregationBuilder) PositionRange() posrange.PositionRange
- func (a *AggregationBuilder) Pretty(level int) string
- func (a *AggregationBuilder) PromQLExpr()
- func (a *AggregationBuilder) String() string
- func (a *AggregationBuilder) Type() parser.ValueType
- func (a *AggregationBuilder) Without(labels ...string) *AggregationBuilder
- type BinaryBuilder
- func Add(left parser.Expr, right parser.Expr) *BinaryBuilder
- func And(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Atan2(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Div(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Eql(left parser.Expr, right parser.Expr) *BinaryBuilder
- func EqlRegex(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Eqlc(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Gte(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Gtr(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Lss(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Lte(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Mod(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Mul(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Neq(left parser.Expr, right parser.Expr) *BinaryBuilder
- func NeqRegex(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Or(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Pow(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Sub(left parser.Expr, right parser.Expr) *BinaryBuilder
- func Unless(left parser.Expr, right parser.Expr) *BinaryBuilder
- func (b *BinaryBuilder) Bool() *BinaryBuilder
- func (b *BinaryBuilder) Ignoring(labels ...string) *BinaryWithVectorMatching
- func (b *BinaryBuilder) On(labels ...string) *BinaryWithVectorMatching
- func (b *BinaryBuilder) PositionRange() posrange.PositionRange
- func (b *BinaryBuilder) Pretty(level int) string
- func (b *BinaryBuilder) PromQLExpr()
- func (b *BinaryBuilder) String() string
- func (b *BinaryBuilder) Type() parser.ValueType
- type BinaryWithVectorMatching
- func (b *BinaryWithVectorMatching) Bool() *BinaryWithVectorMatching
- func (b *BinaryWithVectorMatching) GroupLeft(labels ...string) *BinaryWithVectorMatching
- func (b *BinaryWithVectorMatching) GroupRight(labels ...string) *BinaryWithVectorMatching
- func (b *BinaryWithVectorMatching) PositionRange() posrange.PositionRange
- func (b *BinaryWithVectorMatching) Pretty(level int) string
- func (b *BinaryWithVectorMatching) PromQLExpr()
- func (b *BinaryWithVectorMatching) String() string
- func (b *BinaryWithVectorMatching) Type() parser.ValueType
- type RangeVectorBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsentOverTime ¶
func AbsentOverTime[T RangeVectorBuilder](input T) *parser.Call
func AvgOverTime ¶
func AvgOverTime[T RangeVectorBuilder](input T) *parser.Call
func Changes ¶
func Changes[T RangeVectorBuilder](input T) *parser.Call
func Children ¶ added in v0.2.0
Children returns a list of all child nodes of a syntax tree node.
Taken from https://github.com/prometheus/prometheus/blob/v3.4.0/promql/parser/ast.go#L377 But adds handling cases for promqlbuilder node types.
func CountOverTime ¶
func CountOverTime[T RangeVectorBuilder](input T) *parser.Call
func DeepCopyExpr ¶ added in v0.2.0
DeepCopyExpr copies an expression and all its children recursively. Handler promqlbuilder node types as well.
func Delta ¶
func Delta[T RangeVectorBuilder](input T) *parser.Call
func Deriv ¶
func Deriv[T RangeVectorBuilder](input T) *parser.Call
func DoubleExponentialSmoothing ¶
func DoubleExponentialSmoothing[T RangeVectorBuilder](input T, smoothingFactor float64, trendFactor float64) *parser.Call
func HistogramFraction ¶
func IDelta ¶
func IDelta[T RangeVectorBuilder](input T) *parser.Call
func IRate ¶
func IRate[T RangeVectorBuilder](input T) *parser.Call
func Increase ¶
func Increase[T RangeVectorBuilder](input T) *parser.Call
func Inspect ¶ added in v0.2.0
Inspect traverses an AST in depth-first order: It starts by calling f(node, path); node must not be nil. If f returns a nil error, Inspect invokes f for all the non-nil children of node, recursively.
Taken from https://github.com/prometheus/prometheus/blob/v3.4.0/promql/parser/ast.go#L370 But adds handling cases for promqlbuilder node types.
func LabelReplace ¶
func LastOverTime ¶
func LastOverTime[T RangeVectorBuilder](input T) *parser.Call
func MadOverTime ¶
func MadOverTime[T RangeVectorBuilder](input T) *parser.Call
func MaxOverTime ¶
func MaxOverTime[T RangeVectorBuilder](input T) *parser.Call
func MinOverTime ¶
func MinOverTime[T RangeVectorBuilder](input T) *parser.Call
func NewNumber ¶ added in v0.2.0
func NewNumber(num float64) *parser.NumberLiteral
func NewString ¶ added in v0.2.0
func NewString(s string) *parser.StringLiteral
func PredictLinear ¶
func PredictLinear[T RangeVectorBuilder](input T, t float64) *parser.Call
func PresentOverTime ¶
func PresentOverTime[T RangeVectorBuilder](input T) *parser.Call
func QuantileOverTime ¶
func QuantileOverTime[T RangeVectorBuilder](t float64, input T) *parser.Call
func Rate ¶
func Rate[T RangeVectorBuilder](input T) *parser.Call
func Resets ¶
func Resets[T RangeVectorBuilder](input T) *parser.Call
func StddevOverTime ¶
func StddevOverTime[T RangeVectorBuilder](input T) *parser.Call
func StdvarOverTime ¶
func StdvarOverTime[T RangeVectorBuilder](input T) *parser.Call
func SumOverTime ¶
func SumOverTime[T RangeVectorBuilder](input T) *parser.Call
func Walk ¶ added in v0.2.0
Walk traverses an AST in depth-first order: It starts by calling v.Visit(node, path); node must not be nil. If the visitor w returned by v.Visit(node, path) is not nil and the visitor returns no error, Walk is invoked recursively with visitor w for each of the non-nil children of node, followed by a call of w.Visit(nil), returning an error As the tree is descended the path of previous nodes is provided.
Taken from https://github.com/prometheus/prometheus/blob/v3.4.0/promql/parser/ast.go#L325 But adds handling cases for promqlbuilder node types.
Types ¶
type AggregationBuilder ¶
func Avg ¶
func Avg(vector parser.Expr) *AggregationBuilder
func Count ¶
func Count(vector parser.Expr) *AggregationBuilder
func CountValues ¶
func CountValues(vector parser.Expr) *AggregationBuilder
func Group ¶
func Group(vector parser.Expr) *AggregationBuilder
func LimitRatio ¶
func LimitRatio(vector parser.Expr, ratio float64) *AggregationBuilder
func Max ¶
func Max(vector parser.Expr) *AggregationBuilder
func Min ¶
func Min(vector parser.Expr) *AggregationBuilder
func Stddev ¶
func Stddev(vector parser.Expr) *AggregationBuilder
func Stdvar ¶
func Stdvar(vector parser.Expr) *AggregationBuilder
func Sum ¶
func Sum(vector parser.Expr) *AggregationBuilder
func (*AggregationBuilder) By ¶
func (a *AggregationBuilder) By(labels ...string) *AggregationBuilder
func (*AggregationBuilder) PositionRange ¶
func (a *AggregationBuilder) PositionRange() posrange.PositionRange
func (*AggregationBuilder) Pretty ¶
func (a *AggregationBuilder) Pretty(level int) string
func (*AggregationBuilder) PromQLExpr ¶
func (a *AggregationBuilder) PromQLExpr()
func (*AggregationBuilder) String ¶
func (a *AggregationBuilder) String() string
func (*AggregationBuilder) Type ¶
func (a *AggregationBuilder) Type() parser.ValueType
func (*AggregationBuilder) Without ¶
func (a *AggregationBuilder) Without(labels ...string) *AggregationBuilder
type BinaryBuilder ¶
type BinaryBuilder struct {
// contains filtered or unexported fields
}
func (*BinaryBuilder) Bool ¶ added in v0.2.0
func (b *BinaryBuilder) Bool() *BinaryBuilder
func (*BinaryBuilder) Ignoring ¶
func (b *BinaryBuilder) Ignoring(labels ...string) *BinaryWithVectorMatching
func (*BinaryBuilder) On ¶
func (b *BinaryBuilder) On(labels ...string) *BinaryWithVectorMatching
func (*BinaryBuilder) PositionRange ¶
func (b *BinaryBuilder) PositionRange() posrange.PositionRange
func (*BinaryBuilder) Pretty ¶
func (b *BinaryBuilder) Pretty(level int) string
func (*BinaryBuilder) PromQLExpr ¶
func (b *BinaryBuilder) PromQLExpr()
func (*BinaryBuilder) String ¶
func (b *BinaryBuilder) String() string
func (*BinaryBuilder) Type ¶
func (b *BinaryBuilder) Type() parser.ValueType
type BinaryWithVectorMatching ¶
type BinaryWithVectorMatching struct {
// contains filtered or unexported fields
}
func (*BinaryWithVectorMatching) Bool ¶ added in v0.2.0
func (b *BinaryWithVectorMatching) Bool() *BinaryWithVectorMatching
func (*BinaryWithVectorMatching) GroupLeft ¶
func (b *BinaryWithVectorMatching) GroupLeft(labels ...string) *BinaryWithVectorMatching
func (*BinaryWithVectorMatching) GroupRight ¶
func (b *BinaryWithVectorMatching) GroupRight(labels ...string) *BinaryWithVectorMatching
func (*BinaryWithVectorMatching) PositionRange ¶
func (b *BinaryWithVectorMatching) PositionRange() posrange.PositionRange
func (*BinaryWithVectorMatching) Pretty ¶
func (b *BinaryWithVectorMatching) Pretty(level int) string
func (*BinaryWithVectorMatching) PromQLExpr ¶
func (b *BinaryWithVectorMatching) PromQLExpr()
func (*BinaryWithVectorMatching) String ¶
func (b *BinaryWithVectorMatching) String() string
func (*BinaryWithVectorMatching) Type ¶
func (b *BinaryWithVectorMatching) Type() parser.ValueType
type RangeVectorBuilder ¶ added in v0.2.0
type RangeVectorBuilder interface {
*matrix.Builder | *parser.SubqueryExpr
}