selectors

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValueNull    = "null"
	ValueInt     = "int"
	ValueString  = "string"
	ValueFloat   = "float"
	ValueBoolean = "boolean"
)

Functions

func CreateParser

func CreateParser() (*participle.Parser, error)

Types

type FilterFunction

type FilterFunction struct {
	Filter func(traces.Span, string, Value) error
	Name   string
}

type FirstPseudoClass

type FirstPseudoClass struct{}

func (FirstPseudoClass) Filter

func (fpc FirstPseudoClass) Filter(spans []traces.Span) []traces.Span

func (FirstPseudoClass) Name

func (fpc FirstPseudoClass) Name() string

type LastPseudoClass

type LastPseudoClass struct{}

func (LastPseudoClass) Filter

func (lpc LastPseudoClass) Filter(spans []traces.Span) []traces.Span

func (LastPseudoClass) Name

func (lpc LastPseudoClass) Name() string

type NthChildPseudoClass

type NthChildPseudoClass struct {
	N int64
}

func (NthChildPseudoClass) Filter

func (nc NthChildPseudoClass) Filter(spans []traces.Span) []traces.Span

func (NthChildPseudoClass) Name

func (nc NthChildPseudoClass) Name() string

type ParserSelector

type ParserSelector struct {
	SpanSelectors []parserSpanSelector `( @@* ( "," @@ )*)*`
}

type PseudoClass

type PseudoClass interface {
	Name() string
	Filter(spans []traces.Span) []traces.Span
}

type Selector

type Selector struct {
	SpanSelectors []SpanSelector
}

func FromSpanQuery

func FromSpanQuery(sq test.SpanQuery) Selector

func New

func New(query string) (Selector, error)

func (Selector) Filter

func (s Selector) Filter(trace traces.Trace) traces.Spans

type SelectorParser

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

func (*SelectorParser) Selector

func (sb *SelectorParser) Selector(query string) (Selector, error)

type SpanSelector

type SpanSelector struct {
	Filters       []filter
	PseudoClass   PseudoClass
	ChildSelector *SpanSelector
}

func (SpanSelector) MatchesFilters

func (ss SpanSelector) MatchesFilters(span traces.Span) bool

type Value

type Value struct {
	Type    string
	String  string
	Int     int64
	Float   float64
	Boolean bool
}

func (Value) AsString

func (v Value) AsString() string

Jump to

Keyboard shortcuts

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