Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidSnapshot is returned when a snapshot file is invalid ErrInvalidSnapshot = errors.New("invalid snapshot file") // ErrSnapshotNotFound is returned when a snapshot file is not found ErrSnapshotNotFound = errors.New("snapshot file not found") // ErrOperationCanceled is returned when an operation is canceled ErrOperationCanceled = errors.New("operation canceled") )
Common errors
Functions ¶
func CompareSnapshots ¶
CompareSnapshots returns a list of differences between two snapshots.
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
BloomFilter is a simple bloom filter implementation
func (*BloomFilter) Add ¶
func (bf *BloomFilter) Add(data []byte)
Add adds an item to the bloom filter
func (*BloomFilter) Contains ¶
func (bf *BloomFilter) Contains(data []byte) bool
Contains checks if an item might be in the bloom filter
type DiffEntry ¶
type DiffEntry struct { Type string // "New", "Modified", "Deleted" Path string // Additional fields for detailed diff information OldSize int64 NewSize int64 OldModTime int64 NewModTime int64 OldPermissions uint32 NewPermissions uint32 HashDiff bool // True if the hash differs but size and mtime are the same }
DiffEntry represents a single difference between snapshots
func CompareSnapshotsDetailed ¶
CompareSnapshotsDetailed returns detailed differences between two snapshots.
func CompareSnapshotsDetailedWithOptions ¶
func CompareSnapshotsDetailedWithOptions(ctx context.Context, oldFile, newFile string, options DiffOptions) ([]DiffEntry, error)
CompareSnapshotsDetailedWithOptions returns detailed differences between two snapshots with custom options.
func (DiffEntry) DetailedString ¶
DetailedString returns a detailed string representation of a DiffEntry
type DiffOptions ¶
type DiffOptions struct { // Path prefix to filter entries (for partial diffs) PathPrefix string // Whether to use hash-based diffing UseHashDiff bool // Number of worker goroutines for parallel diffing (0 = auto) Workers int // Whether to use bloom filters for quick detection of changes UseBloomFilter bool }
DiffOptions contains options for controlling the diff operation
func DefaultDiffOptions ¶
func DefaultDiffOptions() DiffOptions
DefaultDiffOptions returns the default diff options
Click to show internal directories.
Click to hide internal directories.