Documentation
¶
Overview ¶
Package fswalker contains functionality to walk a file system and compare the differences.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reporter ¶
type Reporter struct {
// Verbose, when true, makes Reporter print more information for all diffs found.
Verbose bool
// Counter records stats over all processed files, if non-nil.
Counter *metrics.Counter
// contains filtered or unexported fields
}
Reporter compares two Walks against each other based on the config provided and prints a list of diffs between the two.
func ReporterFromConfigFile ¶
ReporterFromConfigFile creates a new Reporter based on a config path.
func (*Reporter) Compare ¶
Compare runs through two Walks (before and after) with a given ReportConfig and shows the diffs.
func (*Reporter) LoadWalks ¶
func (r *Reporter) LoadWalks(ctx context.Context, hostname, reviewFile, walkPath, afterFile, beforeFile string) error
LoadWalks accepts a number of parameters on which it decides how to load the walks to compare. Note that the "before" walk (i.e. last known good) may be legitimately empty.
func (*Reporter) PrintReportSummary ¶
PrintReportSummary prints a few key information pieces around the Report.
func (*Reporter) PrintRuleSummary ¶
PrintRuleSummary prints the configs and policies involved in creating the Walk and Report.
type WalkCallback ¶
WalkCallback is called by Walker at the end of the Run. The callback is typically used to dump the walk to disk and/or perform any other checks. The error return value is propagated back to the Run callers.
type Walker ¶
type Walker struct {
// Function to call once the Walk is complete i.e. to inspect or write the Walk.
WalkCallback WalkCallback
// Verbose, when true, makes Walker print file metadata to stdout.
Verbose bool
// Counter records stats over all processed files, if non-nil.
Counter *metrics.Counter
// contains filtered or unexported fields
}
Walker is able to walk a file structure starting with a list of given includes as roots. All paths starting with any prefix specified in the excludes are ignored. The list of specific files in the hash list are read and a hash sum built for each. Note that this is expensive and should not be done for large files or a large number of files.
func WalkerFromPolicyFile ¶
WalkerFromPolicyFile creates a new Walker based on a policy path.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
reporter
command
Reporter is a CLI tool to process file system report files generated by Walker.
|
Reporter is a CLI tool to process file system report files generated by Walker. |
|
walker
command
Walker is a CLI tool to walk over a set of directories and process all discovered files.
|
Walker is a CLI tool to walk over a set of directories and process all discovered files. |
|
internal
|
|
|
metrics
Package metrics implements generic metrics.
|
Package metrics implements generic metrics. |
|
proto
|
|