pattern

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureVariable

type CaptureVariable struct {
	FieldPath []string
	Ops       []Operation
}

type MatchResult

type MatchResult struct {
	Matched bool
	Vars    []transformer.Variable
}

type Matcher

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

func Parse

func Parse(pattern string) (*Matcher, error)

func (*Matcher) GetAllVariablePaths

func (m *Matcher) GetAllVariablePaths() [][]string

func (*Matcher) Match

func (m *Matcher) Match(path string) MatchResult

type OpType

type OpType int
const (
	NoneOpCode OpType = iota
	MatchOpCode
	AnyOnceCode
	AnyZeroOrMoreCode
	StartCaptureCode
	EndCaptureCode
)

type Operation

type Operation struct {
	OpCode OpType
	Values []string
}

Jump to

Keyboard shortcuts

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