diff

package module
v0.0.0-...-d5e7271 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Upgraded   = -1
	Downgraded = 1
	Added      = 2
)

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(a, b string) int

compareVersions has the same behavior as cmp.Compare, but for package versions. It parses both version strings and checks for differences in major, minor, patch, pre-release, etc.

func DiffPackages

func DiffPackages(oldPackages, newPackages Package) ([]PackageDiff, []PackageDiff, []PackageDiff, []PackageDiff)

PackageDiff returns the difference in packages between two images, organized into four slices: Added, Upgraded, Downgraded, and Removed packages, respectively.

Types

type Package

type Package map[string]string

type PackageDiff

type PackageDiff struct {
	Name            string `json:"name"`
	NewVersion      string `json:"new_version,omitempty"`
	PreviousVersion string `json:"previous_version,omitempty"`
}

Jump to

Keyboard shortcuts

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