stringmatcher

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher interface {
	Matches(str string) bool
}

Matcher interface is used check whether a string matches some pattern.

var Any Matcher = &anyMatcher{}

Any is a Matcher implementation that matches all strings.

type RegexMatcher

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

RegexMatcher implements regular expression string matcher.

func NewRegExMatcher

func NewRegExMatcher(expr string) (*RegexMatcher, error)

NewRegExMatcher returns a new initialized RegexMatcher.

func (*RegexMatcher) Matches

func (em *RegexMatcher) Matches(str string) bool

Matches returns true if str matches em regular expression.

type StringMatcher

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

StringMatcher implements an exact string matcher.

func NewStringMatcher

func NewStringMatcher(strs []string) *StringMatcher

NewStringMatcher returns a new initialized StringMatcher.

func (*StringMatcher) Matches

func (em *StringMatcher) Matches(str string) bool

Matches returns true if str matches any of the em registered strings.

Jump to

Keyboard shortcuts

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