logqlpattern

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 6 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(p Pattern, input string, match func(label logql.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 Parse

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

Parse parses pattern.

Jump to

Keyboard shortcuts

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