Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumSet ¶
type ChecksumSet struct { RootDir string Checksums map[string]FileChecksumInfo }
func ChecksumsForDirAfterAction ¶
func ChecksumsForDirAfterAction(dir string, action func(dir string) error) (ChecksumSet, error)
ChecksumsForDirAfterAction returns the Checksumset for the state of the target directory after running the provided action on it. The target directory is returned to its original state after the action is run. Uses the following process:
* Copies the target directory to a temporary location (unique location in the same parent directory) * Moves the target directory to another temporary location (unique location in the same parent directory) * Moves the copied directory to the original location * Runs the provided action * Computes the checksums for the directory * Removes the directory * Moves the original target directory from the temporary location back to its original location
The result of the above is that the checksums are computed for the directory after the action is run, but the target directory stays in its original state. This function registers a signal handler that restores the state to the original state on SIGINT or SIGTERM signals and then calls os.Exit(1).
func ChecksumsForMatchingPaths ¶
func ChecksumsForMatchingPaths(rootDir string, m matcher.Matcher) (ChecksumSet, error)
func (*ChecksumSet) Diff ¶
func (c *ChecksumSet) Diff(other ChecksumSet) ChecksumsDiff
func (*ChecksumSet) SortedKeys ¶
func (c *ChecksumSet) SortedKeys() []string
type ChecksumsDiff ¶
func (*ChecksumsDiff) String ¶
func (c *ChecksumsDiff) String() string