osinfo

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OsReleasePath    = "etc/os-release"
	AltOSReleasePath = "usr/lib/os-release"
)

Variables

This section is empty.

Functions

func ReadOSPackages added in v0.6.0

func ReadOSPackages(layers []string) (
	layerNum int, packages *[]PackageDBEntry, err error,
)

ReadOSPackages reads a bunch of layers and extracts the os package information from them, it returns the OS package and the layer where they are defined. If the OS is not supported, we return a nil pointer.

Types

type ErrFileNotFoundInTar

type ErrFileNotFoundInTar struct{}

func (ErrFileNotFoundInTar) Error

func (e ErrFileNotFoundInTar) Error() string

type OSType added in v0.6.0

type OSType string
const (
	OSAlpine      OSType = "alpine"
	OSAmazonLinux OSType = "amazonlinux"
	OSCentos      OSType = "centos"
	OSDebian      OSType = "debian"
	OSDistroless  OSType = "distroless"
	OSFedora      OSType = "fedora"
	OSRHEL        OSType = "rhel"
	OSUbuntu      OSType = "ubuntu"
	OSWolfi       OSType = "wolfi"
)

type PackageDBEntry

type PackageDBEntry struct {
	Package         string
	Version         string
	Architecture    string
	Type            string // purl package type (ref: https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst)
	Namespace       string // purl namespace
	MaintainerName  string
	MaintainerEmail string
	HomePage        string
	License         string // License expression
	Checksums       map[string]string
}

func (*PackageDBEntry) DownloadLocation added in v0.6.0

func (e *PackageDBEntry) DownloadLocation() string

DownloadLocation synthesizes a download location for the packages based on known location for the different distros

func (*PackageDBEntry) PackageURL added in v0.3.0

func (e *PackageDBEntry) PackageURL() string

PackageURL returns a purl representing the db entry. If the entry does not have enough data to generate the purl, it will return an empty string

Jump to

Keyboard shortcuts

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