diff

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package diff contains libraries for diffing packages.

Index

Constants

This section is empty.

Variables

Functions

func PkgDiff

func PkgDiff(pkg1, pkg2 string) (sets.String, error)

func SupportedDiffTypesLabel

func SupportedDiffTypesLabel() string

Types

type Command

type Command struct {
	// Path to the local package directory
	Path string

	// Ref is the target Ref in the upstream source package to compare against
	Ref string

	// DiffType specifies the type of changes to show
	DiffType DiffType

	// Difftool refers to diffing commandline tool for showing changes.
	DiffTool string

	// DiffToolOpts refers to the commandline options to for the diffing tool.
	DiffToolOpts string

	// When Debug is true, command will run with verbose logging and will not
	// cleanup the staged packages to assist with debugging.
	Debug bool

	// Output is an io.Writer where command will write the output of the
	// command.
	Output io.Writer

	// PkgDiffer specifies package differ
	PkgDiffer PkgDiffer

	// PkgGetter specifies packaging sourcing adapter
	PkgGetter PkgGetter
}

Command shows changes in local package relative to upstream source pkg, changes in upstream source package between original and target version etc.

func (*Command) DefaultValues

func (c *Command) DefaultValues()

DefaultValues sets up the default values for the command.

func (*Command) Run

func (c *Command) Run(ctx context.Context) error

func (*Command) Validate

func (c *Command) Validate() error

type DiffType

type DiffType string

DiffType represents type of comparison to be performed.

const (
	// DiffTypeLocal shows the changes in local pkg relative to upstream source pkg at original version
	DiffTypeLocal DiffType = "local"
	// DiffTypeRemote shows changes in the upstream source pkg between original and target version
	DiffTypeRemote DiffType = "remote"
	// DiffTypeCombined shows changes in local pkg relative to upstream source pkg at target version
	DiffTypeCombined DiffType = "combined"
	// 3way shows changes in local and remote changes side-by-side
	DiffType3Way DiffType = "3way"
)

func (DiffType) String

func (dt DiffType) String() string

String implements Stringer.

type PkgDiffer

type PkgDiffer interface {
	Diff(pkgs ...string) error
}

PkgDiffer knows how to compare given packages.

type PkgGetter

type PkgGetter interface {
	GetPkg(ctx context.Context, repo, path, ref string) (dir string, err error)
}

PkgGetter knows how to fetch a package given a git repo, path and ref.

Jump to

Keyboard shortcuts

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