Documentation
¶
Index ¶
- func Match(option Option, pattern string, sub ...string) (found []string, err error)
- func MatchFixed(option Option, pattern string, sub ...string) ([]string, error)
- func MatchGlob(option Option, pattern string, sub ...string) ([]string, error)
- func MatchRegexp(option Option, pattern string, sub ...string) ([]string, error)
- func ValidPath(s string) error
- type Chain
- type ErrInvalidPath
- type ErrMaxDepth
- type ErrWalkDir
- type Link
- type MatchFunc
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchFixed ¶
MatchFixed returns the result of calling Match with the given string pattern used to match file names verbatim.
func MatchGlob ¶
MatchGlob returns the result of calling Match with the given string pattern used to match file names according to path.Match semantics.
func MatchRegexp ¶
MatchRegexp returns the result of calling Match with the given string pattern used to match file names according to regexp.Regexp semantics.
Types ¶
type Chain ¶ added in v0.2.0
type Chain []*Link
Chain holds a sequence of Link for a single path component.
func MakeChain ¶ added in v0.2.0
MakeChain creates a new Chain, initialized with the given list of Links.
type ErrInvalidPath ¶
type ErrInvalidPath string
ErrInvalidPath represents an error for a path with invalid symbols.
func (ErrInvalidPath) Error ¶
func (e ErrInvalidPath) Error() string
Error returns a descriptive error string for the receiver ErrInvalidPath e.
type ErrMaxDepth ¶
type ErrMaxDepth int
ErrMaxDepth represents a condition when walking a file system where the number of descendent directories traversed is greater than maximum allowed.
func (ErrMaxDepth) Error ¶
func (e ErrMaxDepth) Error() string
Error returns a descriptive error string for the receiver ErrMaxDepth e.
type ErrWalkDir ¶
type ErrWalkDir []errWalkDir
ErrWalkDir represents a list of errors encountered when calling fs.WalkDir on their corresponding subdirectories.
func (ErrWalkDir) Error ¶
func (e ErrWalkDir) Error() string
Error returns a descriptive error string for the receiver ErrWalkDir e.
type Link ¶ added in v0.2.0
type Link struct {
// contains filtered or unexported fields
}
Link holds a single symlink dereference in a Chain.
func NewLink ¶ added in v0.2.0
NewLink returns a reference to a new Link, initialized with the given file system attributes.
func (*Link) Deref ¶ added in v0.2.0
Deref creates and returns a new Link initialized with the destination's file system attributes of the receive symlink.
type Option ¶
type Option struct { FollowSymlinks bool // Follow symlinks when recursing into subdirectories MaxFollow int // Maximum number symlink components to follow MaxDepth int // Maximum number of subdirectory recursions Expr expr.Expr // Matching semantics of the given pattern IgnoreCase bool // Ignore case in matching semantics WorkingDir string // Current working directory // contains filtered or unexported fields }
Option defines all search and match options for the exported Match functions.