Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DomainMatcherGroup ¶
type DomainMatcherGroup struct {
// contains filtered or unexported fields
}
DomainMatcherGroup is a IndexMatcher for a large set of Domain matchers. Visible for testing only.
type FullMatcherGroup ¶
type FullMatcherGroup struct {
// contains filtered or unexported fields
}
type IndexMatcher ¶
type IndexMatcher interface {
// Match returns the the index of a matcher that matches the input. It returns 0 if no such matcher exists.
Match(input string) uint32
}
IndexMatcher is the interface for matching with a group of matchers.
type Matcher ¶
type Matcher interface {
// Match returns true if the given string matches a predefined pattern.
Match(string) bool
}
Matcher is the interface to determine a string matches a pattern.
type MatcherGroup ¶
type MatcherGroup struct {
// contains filtered or unexported fields
}
MatcherGroup is an implementation of IndexMatcher. Empty initialization works.
func (*MatcherGroup) Add ¶
func (g *MatcherGroup) Add(m Matcher) uint32
Add adds a new Matcher into the MatcherGroup, and returns its index. The index will never be 0.
type Type ¶
type Type byte
Type is the type of the matcher.
const (
// Full is the type of matcher that the input string must exactly equal to the pattern.
Full Type = iota
// Substr is the type of matcher that the input string must contain the pattern as a sub-string.
Substr
// Domain is the type of matcher that the input string must be a sub-domain or itself of the pattern.
Domain
// Regex is the type of matcher that the input string must matches the regular-expression pattern.
Regex
)
Click to show internal directories.
Click to hide internal directories.