osinfo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSDebian     = "debian"
	OSFedora     = "fedora"
	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
}

Jump to

Keyboard shortcuts

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