differ

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package differ provides functionality to compare two apko lock files and identify changes in package versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPackageVersion

func FindPackageVersion(lock pkglock.Lock, packageName string) string

FindPackageVersion returns the resolved version of the named package from the lock file. It searches across all architectures and returns the first match. For a well-formed lock file where all architectures agree on the version this is sufficient.

Types

type PackageChange

type PackageChange struct {
	Name         string
	OldVersion   string // empty string when the package is newly added
	NewVersion   string // empty string when the package was removed
	Architecture string // the architecture of the package
}

PackageChange describes a version change for a single package.

type Result

type Result struct {
	// Changes lists every package whose version changed, was added, or removed.
	Changes []PackageChange
}

Result is the outcome of diffing two lock files.

func Diff

func Diff(oldLock *pkglock.Lock, newLock pkglock.Lock) Result

Diff compares oldLock and newLock and returns the set of changed packages. When oldLock is nil (first-time lock generation) all packages in newLock are treated as new additions.

Jump to

Keyboard shortcuts

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