Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*PatternMatcher)
An Option configures a PatternMatcher.
func WithRegexpProvider ¶
func WithRegexpProvider(p RegexpProvider) Option
WithRegexpProvider sets a custom regexp provider.
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
Pattern defines a single regexp used to filter file paths.
type PatternMatcher ¶
type PatternMatcher struct {
// contains filtered or unexported fields
}
PatternMatcher allows checking paths against a list of patterns.
func NewPatternMatcher ¶
func NewPatternMatcher(patterns []string, opts ...Option) (*PatternMatcher, error)
NewPatternMatcher creates a new matcher object for specific patterns that can be used later to match against patterns against paths.
func (*PatternMatcher) Exclusions ¶
func (pm *PatternMatcher) Exclusions() []*Pattern
Exclusions returns array of negative patterns.
func (*PatternMatcher) Matches ¶
func (pm *PatternMatcher) Matches(file string) bool
Matches matches path against all the patterns. Matches is not safe to be called concurrently.
func (*PatternMatcher) MatchesAny ¶
func (pm *PatternMatcher) MatchesAny(files []string) bool
func (*PatternMatcher) Patterns ¶
func (pm *PatternMatcher) Patterns() []*Pattern
Patterns returns array of active patterns.
Click to show internal directories.
Click to hide internal directories.