prof_parser

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogQLLexerRulesV2 = []lexer.SimpleRule{
	{Name: "Ocb", Pattern: `\{`},
	{Name: "Ccb", Pattern: `\}`},
	{Name: "Comma", Pattern: `,`},

	{Name: "Neq", Pattern: `!=`},
	{Name: "Re", Pattern: `=~`},
	{Name: "Nre", Pattern: `!~`},
	{Name: "Eq", Pattern: `=`},

	{Name: "Dot", Pattern: `\.`},

	{Name: "Label_name", Pattern: `[a-zA-Z_][a-zA-Z0-9_]*`},
	{Name: "Quoted_string", Pattern: `"([^"\\]|\\.)*"`},
	{Name: "Ticked_string", Pattern: "`[^`]*`"},

	{Name: "Integer", Pattern: "[0-9]+"},

	{Name: "space", Pattern: `\s+`},
}
View Source
var ProfLexerDefinition = lexer.MustSimple(LogQLLexerRulesV2)

Functions

This section is empty.

Types

type Script

type Script struct {
	Selectors []Selector `"{" @@? ("," @@ )* ","? "}" `
}

func Parse

func Parse(query string) (*Script, error)

type Selector

type Selector struct {
	Name string `@Label_name`
	Op   string `@("="|"!="|"=~"|"!~")`
	Val  Str    `@@`
}

type Str

type Str struct {
	Str string `@(Quoted_string|Ticked_string)`
}

func (Str) Unquote

func (s Str) Unquote() (string, error)

Jump to

Keyboard shortcuts

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