Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TraceQLLexerDefinition = lexer.MustSimple(TraceQLLexerRulesV2)
View Source
var TraceQLLexerRulesV2 = []lexer.SimpleRule{
{Name: "Ocb", Pattern: `\{`},
{Name: "Ccb", Pattern: `\}`},
{Name: "Ob", Pattern: `\(`},
{Name: "Cb", Pattern: `\)`},
{Name: "Ge", Pattern: `>=`},
{Name: "Le", Pattern: `<=`},
{Name: "Gt", Pattern: `>`},
{Name: "Lt", Pattern: `<`},
{Name: "Neq", Pattern: `!=`},
{Name: "Re", Pattern: `=~`},
{Name: "Nre", Pattern: `!~`},
{Name: "Eq", Pattern: `=`},
{Name: "Label_name", Pattern: `(\.[a-zA-Z_][.a-zA-Z0-9_-]*|[a-zA-Z_][.a-zA-Z0-9_-]*)`},
{Name: "Dot", Pattern: `\.`},
{Name: "And", Pattern: `&&`},
{Name: "Or", Pattern: `\|\|`},
{Name: "Pipe", Pattern: `\|`},
{Name: "Quoted_string", Pattern: `"([^"\\]|\\.)*"`},
{Name: "Ticked_string", Pattern: "`([^`\\\\]|\\\\.)*`"},
{Name: "Minus", Pattern: "-"},
{Name: "Integer", Pattern: "[0-9]+"},
{Name: "space", Pattern: `\s+`},
}
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
Fn string `"|" @("count"|"sum"|"min"|"max"|"avg")`
Attr string `"(" @Label_name? ")"`
Cmp string `@("="|"!="|"<"|"<="|">"|">=")`
Num string `@Minus? @Integer @Dot? @Integer?`
Measurement string `@("ns"|"us"|"ms"|"s"|"m"|"h"|"d")?`
}
func (Aggregator) String ¶
func (a Aggregator) String() string
type AttrSelector ¶
type AttrSelector struct {
Label string `@Label_name`
Op string `@("="|"!="|"<"|"<="|">"|">="|"=~"|"!~")`
Val Value `@@`
}
func (AttrSelector) String ¶
func (a AttrSelector) String() string
type AttrSelectorExp ¶
type AttrSelectorExp struct {
Head *AttrSelector `(@@`
ComplexHead *AttrSelectorExp `| "(" @@ ")" )`
AndOr string `@(And|Or)?`
Tail *AttrSelectorExp `@@?`
}
func (AttrSelectorExp) String ¶
func (a AttrSelectorExp) String() string
type QuotedString ¶
type QuotedString struct {
Str string `@(Quoted_string|Ticked_string) `
}
func (QuotedString) String ¶
func (q QuotedString) String() string
func (*QuotedString) Unquote ¶
func (q *QuotedString) Unquote() (string, error)
type Selector ¶
type Selector struct {
AttrSelector *AttrSelectorExp `"{" @@? "}"`
Aggregator *Aggregator `@@?`
}
type TraceQLScript ¶
type TraceQLScript struct {
Head Selector `@@`
AndOr string `@(And|Or)?`
Tail *TraceQLScript `@@?`
}
func Parse ¶
func Parse(str string) (*TraceQLScript, error)
func (TraceQLScript) String ¶
func (l TraceQLScript) String() string
Click to show internal directories.
Click to hide internal directories.