Documentation
¶
Overview ¶
Package diff provides the functionality for ajfs diff command.
Index ¶
Constants ¶
View Source
const ( ChangedMode = 1 << iota // The path's type and or permissions has changed ChangedSize // The size has changed ChangedModTime // The last modification time has changed ChangedHash // The hash is different )
Variables ¶
View Source
var SkipAll = errors.New("skip all") //nolint:staticcheck //ST1012: not an error and is more readable
Indicates to Compare to stop processing differences.
Functions ¶
func Compare ¶
Compare the differences between two ajfs database files. fn Will be called for each difference that is found. If fn returns SkipAll then the process will be stopped and nil will be returned as the error.
func CompareDatabases ¶
func CompareDatabases(lhs *db.DatabaseFile, rhs *db.DatabaseFile, onlyLHS bool, fn CompareFn) error
Types ¶
type ChangedFlags ¶
type ChangedFlags uint8
Describe what has changed for an item that exists on both sides.
func (ChangedFlags) HashChanged ¶
func (f ChangedFlags) HashChanged() bool
func (ChangedFlags) ModTimeChanged ¶
func (f ChangedFlags) ModTimeChanged() bool
func (ChangedFlags) ModeChanged ¶
func (f ChangedFlags) ModeChanged() bool
func (ChangedFlags) SizeChanged ¶
func (f ChangedFlags) SizeChanged() bool
type CompareFn ¶
Called by Compare for each difference that was found. Return SkipAll to stop the process.
type Config ¶
type Config struct {
config.CommonConfig
LhsPath string
RhsPath string
Fn CompareFn
}
Config for the ajfs diff command.
type Diff ¶
type Diff struct {
Type Type // Type of difference
Id path.Id // Identifier of the path info item
Path string // Path of the item
IsDir bool // Is this a directory
Changed ChangedFlags // What was changed
Size uint64 // Size of the item. If the item exists on both sides, then this would be the size of the LHS item
}
Describe a difference between the LHS and RHS databases.
Click to show internal directories.
Click to hide internal directories.