logqlpattern

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package logqlpattern contains parser for LogQL `pattern` stage pattern.

Index

Constants

View Source
const (
	RequireCapture ParseFlags = 1 << iota
	DisallowNamed

	ExtractorFlags  = RequireCapture
	LineFilterFlags = DisallowNamed
)

Variables

This section is empty.

Functions

func Match

func Match[Label ~string](p Pattern, input string, match func(label Label, value string)) bool

Match matches given pattern against input string.

Types

type ParseFlags added in v0.10.0

type ParseFlags uint8

ParseFlags defines options for Parse.

func (ParseFlags) Has added in v0.10.0

func (f ParseFlags) Has(flag ParseFlags) bool

Has whether if flag is set.

type Part

type Part struct {
	Type  PartType
	Value string
}

Part is a pattern part.

type PartType

type PartType uint8

PartType defines type of Part.

const (
	Capture PartType = iota + 1
	Literal
)

type Pattern

type Pattern struct {
	Parts []Part
}

Pattern is a parsed pattern.

func MustParse added in v0.14.0

func MustParse(input string, flags ParseFlags) Pattern

MustParse is like Parse but panics if the expression cannot be parsed.

func Parse

func Parse(input string, flags ParseFlags) (p Pattern, _ error)

Parse parses LogQL pattern.

Jump to

Keyboard shortcuts

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