Documentation
¶
Overview ¶
Package fswalk provides facilities to process files in bulk by walking down directory trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddExclusions ¶ added in v0.14.4
AddExclusions adds exclusion parameters to the supplied flag set and returns a function that returns the specified slice
Types ¶
type Options ¶
type Options struct {
Exclusions []string // list of excluded doublestar patterns for files
ContinueOnError bool // continue processing other files in the face of errors returned by the processor
VerboseWalk bool // print the dir/ file being walked to stderr
// contains filtered or unexported fields
}
Options are options for processing.
type Processor ¶
type Processor interface {
// Matches returns true if the specified path should be processed. The `userSpecified` argument
// indicates that the file was explicitly passed in by the user.
Matches(path string, file fs.FileInfo, userSpecified bool) bool
// Process processes the specified file and returns an error in case of processing errors.
// When processing is set to continue on errors, it is the function's responsibility to print
// a detailed error. The bulk processor will only return an aggregate error containing stats about
// the number of errors.
Process(path string, file fs.FileInfo) error
}
Processor indicates whether a file matches for processing, and allows some arbitrary processing on it It is only ever given files, never directories for processing.