Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
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.
Click to show internal directories.
Click to hide internal directories.