octosql: github.com/cube2222/octosql/physical/matcher Index | Files

package matcher

import "github.com/cube2222/octosql/physical/matcher"

Index

Package Files

expression.go formula.go matcher.go node.go primitive.go string.go

type AnyFormulaMatcher Uses

type AnyFormulaMatcher struct {
    Name string
}

AnyFormulaMatcher matches any formula.

func (*AnyFormulaMatcher) Match Uses

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

type AnyNamedExpressionListMatcher Uses

type AnyNamedExpressionListMatcher struct {
    Name string
}

AnyNamedExpressionListMatcher matches any named expression list.

func (*AnyNamedExpressionListMatcher) Match Uses

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

type AnyNodeMatcher Uses

type AnyNodeMatcher struct {
    Name string
}

AnyNodeMatcher matches any node.

func (*AnyNodeMatcher) Match Uses

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

type AnyPrimitiveMatcher Uses

type AnyPrimitiveMatcher struct {
    Name string
}

AnyPrimitiveMatcher matches any primitive.

func (*AnyPrimitiveMatcher) Match Uses

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

type AnyStringMatcher Uses

type AnyStringMatcher struct {
    Name string
}

AnyStringMatcher matches any string.

func (*AnyStringMatcher) Match Uses

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

type DataSourceBuilderMatcher Uses

type DataSourceBuilderMatcher struct {
    Name    string
    Formula FormulaMatcher
    Alias   StringMatcher
}

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

func (*DataSourceBuilderMatcher) Match Uses

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

type FilterMatcher Uses

type FilterMatcher struct {
    Name    string
    Formula FormulaMatcher
    Source  NodeMatcher
}

FilterMatcher matches a filter with the given attribute matches.

func (*FilterMatcher) Match Uses

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

type FormulaMatcher Uses

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 Uses

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

func (*MapMatcher) Match Uses

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

type Match Uses

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 Uses

func NewMatch() *Match

NewMatch creates an empty match.

type NamedExpressionListMatcher Uses

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 Uses

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 Uses

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 Uses

type RequalifierMatcher struct {
    Name      string
    Qualifier StringMatcher
    Source    NodeMatcher
}

RequalifierMatcher matches a requalifier with the given attributed matches.

func (*RequalifierMatcher) Match Uses

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

type StringMatcher Uses

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.

Package matcher imports 1 packages (graph) and is imported by 1 packages. Updated 2019-07-14. Refresh now. Tools for package owners.