Documentation
¶
Overview ¶
Package tardiff provides functionality for analyzing and creating binary differences between tar archives.
Index ¶
- func Diff(oldTarFiles []io.ReadSeeker, newTarFile io.ReadSeeker, diffFile io.Writer, ...) error
- func DiffWithSources(sources *SourceAnalysis, oldTarFiles []io.ReadSeeker, newTarFile io.ReadSeeker, ...) error
- type Options
- func (o *Options) SetApplyWhiteouts(apply bool)
- func (o *Options) SetCompressionLevel(compressionLevel int)
- func (o *Options) SetIgnoreSourcePrefixes(prefixes []string)
- func (o *Options) SetMaxBsdiffFileSize(maxBsdiffSize int64)
- func (o *Options) SetSourcePrefixes(prefixes []string)
- func (o *Options) SetTmpDir(dir string)
- type SourceAnalysis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
func Diff(oldTarFiles []io.ReadSeeker, newTarFile io.ReadSeeker, diffFile io.Writer, options *Options) error
Diff creates a binary difference between a set of tar archives and a new tar archive. oldTarFiles contains one or more old tar files, in extraction order.
func DiffWithSources ¶ added in v0.5.0
func DiffWithSources(sources *SourceAnalysis, oldTarFiles []io.ReadSeeker, newTarFile io.ReadSeeker, diffFile io.Writer, options *Options) error
DiffWithSources creates a binary difference using a pre-computed SourceAnalysis. The oldTarFiles must correspond to the same tar files (in the same order) that were passed to AnalyzeSources. If they are independent readers then that allows concurrent calls from multiple goroutines.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options configures the behavior of the diff operation.
func NewOptions ¶
func NewOptions() *Options
NewOptions creates a new Options struct with default values.
func (*Options) SetApplyWhiteouts ¶ added in v0.5.0
SetApplyWhiteouts enables docker/OCI-style whiteout processing when analyzing old tar layers. Whiteout files (.wh.<name> and .wh..wh..opq) in upper layers remove matching paths from lower layers, so the delta sources reflect the merged container image rather than individual layers.
func (*Options) SetCompressionLevel ¶
SetCompressionLevel sets the compression level for the output diff file.
func (*Options) SetIgnoreSourcePrefixes ¶ added in v0.5.0
SetIgnoreSourcePrefixes sets path prefixes to exclude from delta sources. Files whose paths all match one of these prefixes will not be used as delta sources. If a file has multiple names (hardlinks), any non-ignored name makes the file usable.
func (*Options) SetMaxBsdiffFileSize ¶
SetMaxBsdiffFileSize sets the maximum file size for bsdiff operations.
func (*Options) SetSourcePrefixes ¶ added in v0.4.0
SetSourcePrefixes sets path prefixes to filter which source files can be used for delta. Only files whose primary path starts with one of these prefixes will be used as delta sources.
type SourceAnalysis ¶ added in v0.5.0
type SourceAnalysis struct {
// contains filtered or unexported fields
}
SourceAnalysis contains information about pre-analyzed delta sources. It can be reused across multiple DiffWithSources calls, including concurrent calls from different goroutines, as long as each call provides its own independent set of old tar readers.
func AnalyzeSources ¶ added in v0.5.0
func AnalyzeSources(oldTarFiles []io.ReadSeeker, options *Options) (*SourceAnalysis, error)
AnalyzeSources pre-computes analysis of one or more old tar files that can be reused across multiple DiffWithSources operations. oldTarFiles contains one or more old tar files, in extraction order. The readers are only used during this call and are not retained.