Documentation
¶
Overview ¶
Package repocompare loads and compares RPM repository package inventories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentDifference ¶ added in v1.1.0
type ContentDifference struct {
Package string `json:"package"`
Kind string `json:"kind"`
Left []PackageContent `json:"left"`
Right []PackageContent `json:"right"`
}
ContentDifference describes checksum and size differences for one matching package identity.
type DiffStat ¶ added in v1.1.0
type DiffStat struct {
MissingFromRight int `json:"missingFromRight" table:"Missing from right"`
AddedInRight int `json:"addedInRight" table:"Added in right"`
ArchitecturesDiffer int `json:"architecturesDiffer" table:"Architectures differ"`
ContentDifferent int `json:"contentDifferent" table:"Content different"`
ContentComparisonSkipped int `json:"contentComparisonSkipped" table:"Content comparison skipped"`
Total int `json:"total" table:"Total"`
}
DiffStat summarizes package-level inventory differences.
func Summarize ¶ added in v1.1.0
func Summarize(reports []PackageReport) DiffStat
Summarize returns package-level status and total counts.
type Fetcher ¶
type Fetcher interface {
// Fetch returns the bytes at rawURL.
Fetch(ctx context.Context, rawURL string, disableSSLVerify bool) ([]byte, error)
}
Fetcher retrieves repository metadata.
type HTTPFetcher ¶
type HTTPFetcher struct {
Attempts int
}
HTTPFetcher retrieves repository metadata over HTTP with bounded retries.
type MissingFromRightStat ¶ added in v1.1.0
type MissingFromRightStat struct {
MissingFromRight int `json:"missingFromRight" table:"Missing from right"`
}
MissingFromRightStat summarizes package versions missing from the right inventory.
type MissingPackage ¶ added in v1.1.0
type MissingPackage struct {
Name string `json:"name" table:"Name"`
Version string `json:"version" table:"Version"`
}
MissingPackage is a package version present on the left but absent from the right.
func MissingFromRight ¶ added in v1.1.0
func MissingFromRight(left, right []Package) []MissingPackage
MissingFromRight returns sorted package versions that occur only in the left inventory. Architectures and artifact kinds do not affect membership.
type Package ¶
type Package struct {
Name string
Epoch string
Version string
Release string
Arch string
Kind projectconfig.SubrepoKind
ChecksumType string
Checksum string
Size int64
}
Package identifies one package in RPM primary metadata.
func LoadRepositories ¶
func LoadRepositories( ctx context.Context, fetcher Fetcher, repositories []Repository, ) ([]Package, error)
LoadRepositories snapshots each repository's repomd document before loading its primary metadata.
func (Package) EVR ¶
EVR returns the package's epoch, version, and release without its architecture.
type PackageContent ¶ added in v1.1.0
type PackageContent struct {
ChecksumType string `json:"checksumType"`
Checksum string `json:"checksum"`
Size int64 `json:"size"`
}
PackageContent identifies one checksum and size variant of a package identity.
type PackageReport ¶
type PackageReport struct {
Name string `json:"name" table:"Name"`
Summary string `json:"summary" table:"Summary"`
LeftNEVRs string `json:"leftNevrs" table:"Left NEVRs"`
RightNEVRs string `json:"rightNevrs" table:"Right NEVRs"`
ContentDifferences []ContentDifference `json:"contentDifferences,omitempty" table:"-"`
}
PackageReport summarizes both inventories for one differing package name.
func Compare ¶
func Compare(left, right []Package) ([]PackageReport, error)
Compare returns one package-centric report for each package name with inventory differences.
func CompareWithOptions ¶ added in v1.1.0
func CompareWithOptions(left, right []Package, options Options) ([]PackageReport, error)
CompareWithOptions returns package-centric reports using the selected comparison behavior.
type PackageStatus ¶
type PackageStatus string
PackageStatus summarizes why a package name appears in the comparison.
const ( // PackageStatusMissingFromRight indicates that the left contains an identity absent from the right. PackageStatusMissingFromRight PackageStatus = "missing-from-right" // PackageStatusAddedInRight indicates that the right contains an identity absent from the left. PackageStatusAddedInRight PackageStatus = "added-in-right" // PackageStatusArchitecturesDiffer indicates that matching NEVRs have different architecture sets. PackageStatusArchitecturesDiffer PackageStatus = "architectures-differ" // PackageStatusContentDifferent indicates that matching package identities have different content. PackageStatusContentDifferent PackageStatus = "content-different" // PackageStatusContentComparisonSkipped indicates that matching package identities use different checksum algorithms. PackageStatusContentComparisonSkipped PackageStatus = "content-comparison-skipped" )
type Repository ¶
type Repository struct {
ID string
Kind projectconfig.SubrepoKind
URL string
DisableSSLVerify bool
}
Repository describes one physical RPM repository.