logparser

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJSON

func IsJSON(s string) (map[string]any, bool)

func IsLogfmt

func IsLogfmt(s string) (string, string, bool)

Types

type Lexer

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

func (*Lexer) Advance

func (l *Lexer) Advance()

func (*Lexer) Group

func (l *Lexer) Group(start, end byte) (_ string, ok bool)

func (*Lexer) NextByte

func (l *Lexer) NextByte() byte

func (*Lexer) PeekByte

func (l *Lexer) PeekByte() byte

func (*Lexer) Pos

func (l *Lexer) Pos() int

func (*Lexer) ReadQuoted

func (l *Lexer) ReadQuoted(quote byte) (string, error)

func (*Lexer) ReadSep

func (l *Lexer) ReadSep(sep byte) (_ string, ok bool)

func (*Lexer) ReadSepFunc

func (l *Lexer) ReadSepFunc(start int, isSep func(byte) bool) (_ string, ok bool)

func (*Lexer) ReadUnquoted

func (l *Lexer) ReadUnquoted(quote byte) (string, error)

func (*Lexer) Reset

func (l *Lexer) Reset(s string)

func (*Lexer) Rewind

func (l *Lexer) Rewind()

func (*Lexer) SetPos

func (l *Lexer) SetPos(pos int)

func (*Lexer) Slice

func (l *Lexer) Slice(s, e int) string

func (*Lexer) Valid

func (l *Lexer) Valid() bool

type SyntaxError

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

func (SyntaxError) Error

func (e SyntaxError) Error() string

type Token

type Token struct {
	Type TokenType
	Text string
}

type TokenType

type TokenType int8
const (
	InvalidToken TokenType = iota
	WordToken
	QuotedToken
	ParamToken
)

type Tokenizer

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

func NewTokenizer

func NewTokenizer(s string) *Tokenizer

func (*Tokenizer) NextToken

func (t *Tokenizer) NextToken() Token

Jump to

Keyboard shortcuts

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