Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NFAMatchingEverything = NFA{ // contains filtered or unexported fields }
NFAMatchingEverything is a predeclared NFA that matches all non-empty paths.
var NFAMatchingNothing = NFA{ // contains filtered or unexported fields }
NFAMatchingNothing is a predeclared NFA that never matches any paths.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher of globs. Zero initialized instances correspond to an empty state machine that does not match any strings.
func (*Matcher) CopyFrom ¶
CopyFrom overwrites the state of the matcher with that of another matcher. This can be used branch the matching process, or reset it to a previous state.
This function is implemented so that it reuses previously allocated memory. It is therefore recommended to reuse instances of Matcher as much as possible.
func (*Matcher) Initialize ¶
Initialize a matcher by letting it point to the initial state of a provided nondeterministic finite automaton (NFA).
func (*Matcher) IsMatch ¶
IsMatch returns true if the currently parsed input corresponds to a match.
func (*Matcher) WriteRune ¶
WriteRune matches a single character of pathname strings against the patterns encoded in the NFA. Upon completion, it returns whether there are still any reachable states that would allow matching to succeed. When false is returned, the caller should terminate the matching process immediately.
type NFA ¶
type NFA struct {
// contains filtered or unexported fields
}
NFA is a nondeterministic finite automaton of a set of glob patterns. This automaton can be used to perform matching of glob patterns against paths.
func NewNFAFromBytes ¶
NewNFAFromBytes reobtains a nondeterministic finite automaton (NFA) that is capable of matching paths from a previously generated binary representation.
func NewNFAFromPatterns ¶
NewNFAFromPatterns compiles a set of glob patterns into a nondeterministic finite automaton (NFA) that is capable of matching paths.
func NewNFAFromSuffixes ¶
NewNFAFromSuffixes compiles a set of filename suffixes into a nondeterministic finite automaton (NFA) that is capable of matching paths having one of the provided suffixes.