Documentation ¶
Overview ¶
Package variableblk provides a file diff method based on the following algorithm: Scan the files and compare byte by byte. For a byte stream that is the same, it is skipped if it reaches certain length; the bytes are included in the pwrite even though they are the same, this is to avoid sending smaller pwrites. For bytes stream that is not the same, generates a pwrite as large as possible(pre-defined length).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct { }
Factory is a helper for creating a new file differ factory
func (Factory) DiffContents ¶
func (factory Factory) DiffContents(f1, f2 blobdiffer.FileInfo, target string, records chan<- record.Record, hf dlhash.Factory) error
DiffContents reads the files in a chunk, compares byte by byte, generates a pwrite for every unmatched variable sized blocks. Caller is expected to close the records channel.