types

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	// Name is the name of the binary package.
	Name string `json:"Package"`
	// Source is the name of the source package from which this package is built.
	Source string
	// Version is the version of the package.
	Version version.Version
	// InstalledSize is the estimated installed size of the package, in kilobytes.
	InstalledSize int `json:"Installed-Size,omitempty,string"`
	// Maintainer is the name and email address of the person or organization responsible for the package.
	Maintainer string
	// Architecture is the Debian machine architecture the package is built for.
	Architecture arch.Arch
	// MultiArch is the multi-architecture field, specifying if the package can be installed alongside other architectures.
	// Valid values are "same", "foreign", or the name of an architecture.
	MultiArch string `json:"Multi-Arch"`
	// Replaces lists other packages that this package replaces.
	Replaces dependency.Dependency
	// Breaks lists other packages that this package breaks.
	Breaks dependency.Dependency
	// Provides lists virtual packages that this package provides.
	Provides dependency.Dependency
	// Conflicts lists other packages that conflict with this package.
	Conflicts dependency.Dependency
	// Enhances lists packages that this package enhances.
	Enhances dependency.Dependency
	// Depends lists packages that this package depends on.
	Depends dependency.Dependency
	// Recommends lists packages that are recommended to be installed with this package.
	Recommends dependency.Dependency
	// Suggests lists packages that are suggested to be installed with this package.
	Suggests dependency.Dependency
	// PreDepends lists packages that must be installed and configured before this package.
	PreDepends dependency.Dependency `json:"Pre-Depends"`
	// Description provides a short description and a long description of the package.
	Description string
	// Homepage is the URL of the package's homepage, typically where more information can be found.
	Homepage string
	// Tag lists tags associated with the package, separated by commas.
	Tag list.CommaDelimited[string]
	// Section categorizes the package within the Debian archive, such as "admin", "devel", or "x11".
	Section string
	// Priority defines the importance of the package within the Debian system, such as "required", "standard", or "optional".
	Priority string
	// Essential indicates if the package is essential for the system to function. If true, the package cannot be removed.
	Essential *boolean.Boolean `json:",omitempty"`
	// Important indicates if the package is important for the system to function. This is less strict than Essential.
	Important *boolean.Boolean `json:",omitempty"`
	// Protected indicates if the package is protected, containing important system boot infrastructure.
	Protected *boolean.Boolean `json:",omitempty"`
	// Filename is the name of the package file.
	Filename string
	// Size is the size of the package file, in bytes.
	Size int `json:",omitempty,string"`
	// SHA256 is the SHA-256 checksum of the package file for integrity verification.
	SHA256 string

	// Status indicates the current status of the package (e.g., "install ok installed").
	Status list.SpaceDelimited[string] `json:",omitempty"`
	// ConfigVersion is the version of the package to which the configuration files belong.
	ConfigVersion *version.Version `json:"Config-Version,omitempty"`
	// Conffiles lists configuration files that are part of the package.
	Conffiles list.NewLineDelimited[string] `json:",omitempty"`
}

Package represents a Debian package with all its metadata fields.

func (Package) Compare

func (a Package) Compare(b Package) int

Compare compares two packages by name, version, and architecture. It returns an integer comparing the two packages lexicographically.

func (Package) ID

func (p Package) ID() string

ID returns a unique identifier for the package, combining the name, version, and architecture.

type Release

type Release struct {
	// Origin specifies the origin of the release, typically indicating the entity that created it.
	Origin string
	// Label provides a human-readable label for the release.
	Label string
	// Suite indicates the suite (such as stable, testing, unstable) the release belongs to.
	Suite string
	// Version denotes the version number of the release.
	Version string
	// Codename is the codename assigned to the release (e.g., "buster", "bullseye").
	Codename string
	// Changelogs provides the URL to the changelogs for the release, detailing changes and updates.
	Changelogs string
	// Date is the timestamp indicating when the release was published.
	Date time.Time
	// ValidUntil specifies the date until which the release is considered valid. It is optional.
	ValidUntil *time.Time `json:"Valid-Until,omitempty"`
	// Architectures lists the CPU architectures supported by the release (e.g., amd64, i386).
	Architectures list.SpaceDelimited[arch.Arch]
	// Components lists the repository components available in the release (e.g., main, contrib, non-free).
	Components list.SpaceDelimited[string]
	// Description provides a brief description of the release.
	Description string
	// SHA256 lists SHA-256 checksums for files in the release, used for stronger integrity verification.
	SHA256 list.NewLineDelimited[filehash.FileHash]
	// AcquireByHash indicates if the release uses hash-based acquisition for file retrieval.
	AcquireByHash *boolean.Boolean `json:"Acquire-By-Hash,omitempty"`
	// SignedBy lists OpenPGP key fingerprints to be used for validating the next Release file.
	SignedBy list.CommaDelimited[string] `json:"Signed-By,omitempty"`
}

Release represents a Debian release with its associated metadata.

func (*Release) SHA256Sums

func (r *Release) SHA256Sums() (map[string][]byte, error)

SHA256Sums returns a map of SHA-256 checksums for files in the release.

Directories

Path Synopsis
Package dependency provides an interface to parse and inspect Debian * Dependency relationships.
Package dependency provides an interface to parse and inspect Debian * Dependency relationships.

Jump to

Keyboard shortcuts

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