logparser

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AND = 57362
View Source
const AS = 57347
View Source
const BITWISE_OR = 57363
View Source
const COLON = 57364
View Source
const COMMA = 57365
View Source
const DefaultFieldForFullText = "__log___"
View Source
const EQ = 57353
View Source
const EXTRACT = 57346
View Source
const GT = 57356
View Source
const GTE = 57357
View Source
const IDENT = 57359
View Source
const IN = 57352
View Source
const LPAREN = 57348
View Source
const LSQUARE = 57350
View Source
const LT = 57354
View Source
const LTE = 57355
View Source
const NEQ = 57358
View Source
const OR = 57361
View Source
const RPAREN = 57349
View Source
const RSQUARE = 57351
View Source
const STRING = 57360

Variables

This section is empty.

Functions

func ScanString

func ScanString(r io.RuneScanner) (string, error)

ScanString reads a quoted string from a rune reader.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser represents an InfluxQL parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) GetScanner

func (p *Parser) GetScanner() *Scanner

func (*Parser) Release

func (p *Parser) Release()

type Pos

type Pos struct {
	Line int
	Char int
}

Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner represents a lexical scanner for InfluxQL.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, pos Pos, lit string)

Scan returns the next token and position from the underlying reader. Also returns the literal text read for strings, numbers, and duration tokens since these token types can have different literal representations.

type Token

type Token int

Token is a lexical token of the InfluxQL language.

const (
	// ILLEGAL Token, EOF, WS are Special InfluxQL tokens.
	ILLEGAL Token = iota
	EOF
	WS

	BADSTRING // "abc
	BADESCAPE // \q
)

These are a comprehensive list of InfluxQL language tokens.

func Lookup

func Lookup(ident string) Token

Lookup returns the token associated with a given string.

func (Token) String

func (tok Token) String() string

String returns the string representation of the token.

type YyParser

type YyParser struct {
	Query   influxql.Query
	Scanner *Scanner
	// contains filtered or unexported fields
}

func NewYyParser

func NewYyParser(s *Scanner) YyParser

func (*YyParser) Error

func (p *YyParser) Error(err string)

func (*YyParser) GetQuery

func (p *YyParser) GetQuery() (*influxql.Query, error)

func (*YyParser) Lex

func (p *YyParser) Lex(lval *yySymType) int

func (*YyParser) ParseTokens

func (p *YyParser) ParseTokens()

func (*YyParser) SetScanner

func (p *YyParser) SetScanner(s *Scanner)

type YyParserError

type YyParserError string

func (YyParserError) Error

func (p YyParserError) Error() string

Jump to

Keyboard shortcuts

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