comparison

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtraGroup

type ExtraGroup struct {
	Checksum  string
	Filenames []string
}

type Relocation

type Relocation struct {
	OriginalFileNames []string
	NewFileNames      []string

	ExtraOriginalFileNames []string
	MissingNewFileNames    []string
}

func (*Relocation) IsDecreasingDuplicates

func (r *Relocation) IsDecreasingDuplicates() bool

func (*Relocation) IsIncreasingDuplicates

func (r *Relocation) IsIncreasingDuplicates() bool

type Result

type Result struct {
	AllBaseFiles  []string
	AllOtherFiles []string

	Relocations []Relocation

	// Paths to be having new content, after original file in base archive is moved to a new path
	NewContentAfterMove []string

	NewContentToOverwrite []string

	UnmatchedBaseExtras  []ExtraGroup
	UnmatchedOtherExtras []ExtraGroup
}

func Execute

func Execute(
	base archive.Reader,
	other archive.Reader,
) (Result, error)

Execute compares base archive against other archive.

Comparison result should provide set of changes needed to update other archive to match base archive.

func (Result) PrintAll

func (compareResult Result) PrintAll(p pretty.Printfer, baseName string, otherName string)

func (Result) PrintRelocations

func (compareResult Result) PrintRelocations(out pretty.Printfer)

func (Result) PrintStats

func (compareResult Result) PrintStats(
	out pretty.Printfer,
	baseName string,
	otherName string,
)

func (Result) PrintUnmatchedBaseExtras

func (compareResult Result) PrintUnmatchedBaseExtras(out pretty.Printfer, baseName string, _ string)

func (Result) PrintUnmatchedOtherExtras

func (compareResult Result) PrintUnmatchedOtherExtras(out pretty.Printfer, _ string, otherName string)

Jump to

Keyboard shortcuts

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