Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Glob ¶
func Glob(patterns []string) ([]*FileAsset, []*RegexpInfo, error)
Glob returns files and dirctories that match patterns. Patterns must use slashes, even Windows.
Special chars.
/**/ - match zero or more directories {a,b} - match a or b, no spaces * - match any non-separator char ? - match a single non-separator char **/ - match any directory, start of pattern only /** - match any this directory, end of pattern only ! - removes files from resultset, start of pattern only
func Globexp ¶
Globexp builds a regular express from from extended glob pattern and then returns a Regexp object.
func PatternRoot ¶
PatternRoot gets a real directory root from a pattern. The directory returned is used as the start location for globbing.
Types ¶
type RegexpInfo ¶
RegexpInfo contains additional info about the Regexp created by a glob pattern.
func (*RegexpInfo) MatchString ¶
func (ri *RegexpInfo) MatchString(s string) bool
MatchString matches a string with either a regexp or direct string match
type WatchCriteria ¶
type WatchCriteria struct {
Items []*WatchCriterion
}
WatchCriteria is the set of criterion to watch one or more glob patterns.
func EffectiveCriteria ¶
func EffectiveCriteria(globs ...string) (*WatchCriteria, error)
EffectiveCriteria is the minimum set of criteria to watch the items in patterns
func (*WatchCriteria) Matches ¶
func (cr *WatchCriteria) Matches(pth string) bool
Matches determines if pth is matched by internal criteria.
func (*WatchCriteria) Roots ¶
func (cr *WatchCriteria) Roots() []string
Roots returns the root paths of all criteria.
type WatchCriterion ¶
type WatchCriterion struct { // Root is the root directory to start watching. Root string // Includes are the regexp for including files IncludesRegexp []*regexp.Regexp // Excludes are the regexp for excluding files ExcludesRegexp []*regexp.Regexp Includes []string Excludes []string }
WatchCriterion is the criteria needed to test if a file matches a pattern.