matcher

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyFormulaMatcher

type AnyFormulaMatcher struct {
	Name string
}

AnyFormulaMatcher matches any formula.

func (*AnyFormulaMatcher) Match

func (m *AnyFormulaMatcher) Match(match *Match, formula physical.Formula) bool

type AnyNamedExpressionListMatcher

type AnyNamedExpressionListMatcher struct {
	Name string
}

AnyNamedExpressionListMatcher matches any named expression list.

func (*AnyNamedExpressionListMatcher) Match

func (m *AnyNamedExpressionListMatcher) Match(match *Match, expressions []physical.NamedExpression) bool

type AnyNodeMatcher

type AnyNodeMatcher struct {
	Name string
}

AnyNodeMatcher matches any node.

func (*AnyNodeMatcher) Match

func (m *AnyNodeMatcher) Match(match *Match, node physical.Node) bool

type AnyPrimitiveMatcher

type AnyPrimitiveMatcher struct {
	Name string
}

AnyPrimitiveMatcher matches any primitive.

func (*AnyPrimitiveMatcher) Match

func (m *AnyPrimitiveMatcher) Match(match *Match, primitive interface{}) bool

type AnyStringMatcher

type AnyStringMatcher struct {
	Name string
}

AnyStringMatcher matches any string.

func (*AnyStringMatcher) Match

func (m *AnyStringMatcher) Match(match *Match, text string) bool

type DataSourceBuilderMatcher

type DataSourceBuilderMatcher struct {
	Name    string
	Formula FormulaMatcher
	Alias   StringMatcher
}

DataSourceBuilderMatcher matches a data source builder with the given attribute matches.

func (*DataSourceBuilderMatcher) Match

func (m *DataSourceBuilderMatcher) Match(match *Match, node physical.Node) bool

type FilterMatcher

type FilterMatcher struct {
	Name    string
	Formula FormulaMatcher
	Source  NodeMatcher
}

FilterMatcher matches a filter with the given attribute matches.

func (*FilterMatcher) Match

func (m *FilterMatcher) Match(match *Match, node physical.Node) bool

type FormulaMatcher

type FormulaMatcher interface {
	// Match tries to match a formula filling the match. Returns true on success.
	Match(match *Match, formula physical.Formula) bool
}

FormulaMatcher is used to match formulas on different predicates.

type MapMatcher

type MapMatcher struct {
	Name        string
	Expressions NamedExpressionListMatcher
	Keep        PrimitiveMatcher
	Source      NodeMatcher
}

func (*MapMatcher) Match

func (m *MapMatcher) Match(match *Match, node physical.Node) bool

type Match

type Match struct {
	Formulas             map[string]physical.Formula
	NamedExpressionLists map[string][]physical.NamedExpression
	Nodes                map[string]physical.Node
	Primitives           map[string]interface{}
	Strings              map[string]string
}

Match represents a single scenario match. It gets filled with matched objects on the way.

func NewMatch

func NewMatch() *Match

NewMatch creates an empty match.

type NamedExpressionListMatcher

type NamedExpressionListMatcher interface {
	// Match tries to match a named expression list filling the match. Returns true on success.
	Match(match *Match, expressions []physical.NamedExpression) bool
}

NamedExpressionListMatcher is used to match named expressions on various predicates.

type NodeMatcher

type NodeMatcher interface {
	// Match tries to match a node filling the match. Returns true on success.
	Match(match *Match, node physical.Node) bool
}

NodeMatcher is used to match nodes on various predicates.

type PrimitiveMatcher

type PrimitiveMatcher interface {
	// Match tries to match a primitive filling the match. Returns true on success.
	Match(match *Match, node interface{}) bool
}

PrimitiveMatcher is used to primitives on various predicates.

type RequalifierMatcher

type RequalifierMatcher struct {
	Name      string
	Qualifier StringMatcher
	Source    NodeMatcher
}

RequalifierMatcher matches a requalifier with the given attributed matches.

func (*RequalifierMatcher) Match

func (m *RequalifierMatcher) Match(match *Match, node physical.Node) bool

type StringMatcher

type StringMatcher interface {
	// Match tries to match a string filling the match. Returns true on success.
	Match(match *Match, text string) bool
}

StringMatcher is used to match strings on different predicates.

Jump to

Keyboard shortcuts

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