common

package
v0.45.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Left  Value  `@@`
	Op    string `@("==" | "!=")`
	Right Value  `@@`
}

Condition represents an optional boolean condition on the RHS of a query. nolint:govet

type Field

type Field struct {
	Name   string  `@Ident`
	MapKey *string `( "[" @String "]" )?`
}

Field is an item within a Path. nolint:govet

type Invocation

type Invocation struct {
	Function  string  `@Ident`
	Arguments []Value `"(" ( @@ ( "," @@ )* )? ")"`
}

Invocation represents a function call. nolint:govet

type ParsedQuery added in v0.45.0

type ParsedQuery struct {
	Invocation Invocation `@@`
	Condition  *Condition `( "where" @@ )?`
}

ParsedQuery represents a parsed query. It is the entry point into the query DSL. nolint:govet

func Parse

func Parse(raw string) (*ParsedQuery, error)

type Path

type Path struct {
	Fields []Field `@@ ( "." @@ )*`
}

Path represents a telemetry path expression. nolint:govet

type Value

type Value struct {
	Invocation *Invocation `( @@`
	String     *string     `| @String`
	Float      *float64    `| @Float`
	Int        *int64      `| @Int`
	Path       *Path       `| @@ )`
}

Value represents a part of a parsed query which is resolved to a value of some sort. This can be a telemetry path expression, function call, or literal. nolint:govet

Jump to

Keyboard shortcuts

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