diff

package
v0.6.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffResult

type DiffResult struct {
	NewImage     *remote.ImageMetadata
	BaseImage    *remote.ImageMetadata
	LayerDiffs   []LayerDiff
	NewLayers    []LayerDiff
	SharedLayers []LayerDiff

	// Size statistics
	NewLayersSize     int64
	SharedLayersSize  int64
	TotalNewImageSize int64
	SavingsSize       int64
	SavingsPercentage float64
}

DiffResult contains the result of comparing two images

type Differ

type Differ struct {
	// contains filtered or unexported fields
}

Differ compares two container images

func NewDiffer

func NewDiffer(fetcher *remote.Fetcher) *Differ

NewDiffer creates a new Differ

func (*Differ) Compare

func (d *Differ) Compare(ctx context.Context, newImageRef, baseImageRef, platform string) (*DiffResult, error)

Compare compares two images and returns the differences

type FormatOptions

type FormatOptions struct {
	Format  OutputFormat
	Verbose bool
}

FormatOptions contains options for formatting output

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter formats diff results for output

func NewFormatter

func NewFormatter(options FormatOptions) *Formatter

NewFormatter creates a new Formatter with the given options

func (*Formatter) Format

func (f *Formatter) Format(w io.Writer, result *DiffResult) error

Format writes the formatted diff result to the writer

type LayerDiff

type LayerDiff struct {
	DiffID  v1.Hash
	Digest  v1.Hash
	Size    int64
	Command string
	Status  LayerStatus
}

LayerDiff represents the difference information for a single layer

type LayerStatus

type LayerStatus string

LayerStatus represents the status of a layer in the diff

const (
	LayerStatusNew    LayerStatus = "NEW"
	LayerStatusShared LayerStatus = "SHARED"
)

type OutputFormat

type OutputFormat string

OutputFormat represents the output format type

const (
	OutputFormatText OutputFormat = "text"
	OutputFormatJSON OutputFormat = "json"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL