Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultIgnorefile = ".xignore"
DefaultIgnorefile default ignorefile name ".xignore"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ignorefile ¶
type Ignorefile struct {
Patterns []string
}
Ignorefile ignore file
func (*Ignorefile) FromReader ¶
func (f *Ignorefile) FromReader(reader io.Reader) error
FromReader reads patterns from reader. This will trim whitespace from each line as well as use GO's "clean" func to get the shortest/cleanest path for each.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher xignore matcher
func NewMatcher ¶ added in v0.3.1
NewMatcher create matcher from custom filesystem
func NewSystemMatcher ¶
func NewSystemMatcher() *Matcher
NewSystemMatcher create matcher for system filesystem
func (*Matcher) Matches ¶
func (m *Matcher) Matches(basedir string, options *MatchesOptions) (*MatchesResult, error)
Matches returns matched files from dir files.
type MatchesOptions ¶
type MatchesOptions struct {
// Ignorefile name, similar '.gitignore', '.dockerignore', 'chefignore'
Ignorefile string
// Allow nested ignorefile
Nested bool
// apply patterns before all ignorefile
BeforePatterns []string
// apply patterns after all ignorefile
AfterPatterns []string
}
MatchesOptions matches options
type MatchesResult ¶
type MatchesResult struct {
BaseDir string
// ignorefile rules matched files
MatchedFiles []string
// ignorefile rules unmatched files
UnmatchedFiles []string
// ignorefile rules matched dirs
MatchedDirs []string
// ignorefile rules unmatched dirs
UnmatchedDirs []string
}
MatchesResult matches result
func DirMatches ¶
func DirMatches(basedir string, options *MatchesOptions) (*MatchesResult, error)
DirMatches returns match result from basedir.
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
Pattern defines a single regexp used used to filter file paths.
func (*Pattern) IsExclusion ¶
IsExclusion returns true if this pattern defines exclusion
Click to show internal directories.
Click to hide internal directories.