osinfo

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSDebian     = "debian"
	OSUbuntu     = "ubuntu"
	OSFedora     = "fedora"
	OSCentos     = "centos"
	OSRHEL       = "rhel"
	OSAlpine     = "alpine"
	OSDistroless = "distroless"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerScanner

type ContainerScanner struct{}

TODO: Move functions to its own implementation

func (*ContainerScanner) ReadDebianPackages

func (ct *ContainerScanner) ReadDebianPackages(layers []string) (layer int, pk *[]PackageDBEntry, err error)

ReadDebianPackages scans through a set of container layers looking for the last update to the debian package datgabase. If found, extracts it and sends it to parseDpkgDB to extract the package information from the file.

func (*ContainerScanner) ReadOSPackages

func (ct *ContainerScanner) 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.

type ErrFileNotFoundInTar

type ErrFileNotFoundInTar struct{}

func (ErrFileNotFoundInTar) Error

func (e ErrFileNotFoundInTar) Error() string

type LayerScanner

type LayerScanner struct{}

TODO: Move functions to its own implementation

func (*LayerScanner) OSReleaseData

func (loss *LayerScanner) OSReleaseData(layerPath string) (osrelease string, err error)

CanHandle looks at an image tarball and checks if it looks like a debian filesystem

func (*LayerScanner) OSType

func (loss *LayerScanner) OSType(layerPath string) (ostype string, err error)

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
}

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