distro

package
v0.0.0-...-63db9e9 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

All contains all Linux distribution options

View Source
var IDMapping = map[string]Type{
	"debian":        Debian,
	"ubuntu":        Ubuntu,
	"rhel":          RedHat,
	"centos":        CentOS,
	"fedora":        Fedora,
	"alpine":        Alpine,
	"busybox":       Busybox,
	"amzn":          AmazonLinux,
	"ol":            OracleLinux,
	"arch":          ArchLinux,
	"opensuse-leap": OpenSuseLeap,
	"sles":          SLES,
	"photon":        Photon,
	"windows":       Windows,
	"mariner":       Mariner,
	"rocky":         RockyLinux,
	"almalinux":     AlmaLinux,
	"gentoo":        Gentoo,
	"wolfi":         Wolfi,
	"chainguard":    Chainguard,
}

IDMapping connects a distro ID like "ubuntu" to a Distro type

Functions

This section is empty.

Types

type Distro

type Distro struct {
	Type       Type
	Version    *hashiVer.Version
	RawVersion string
	IDLike     []string
}

Distro represents a Linux Distribution.

func New

func New(t Type, version string, idLikes ...string) (*Distro, error)

New creates a new Distro object populated with the given values.

func NewFromRelease

func NewFromRelease(release linux.Release) (*Distro, error)

NewFromRelease creates a new Distro object derived from a syft linux.Release object.

func (Distro) Disabled

func (d Distro) Disabled() bool

Unsupported Linux distributions

func (Distro) FullVersion

func (d Distro) FullVersion() string

FullVersion returns the original user version value.

func (Distro) IsRolling

func (d Distro) IsRolling() bool

func (Distro) MajorVersion

func (d Distro) MajorVersion() string

MajorVersion returns the major version value from the pseudo-semantically versioned distro version value.

func (Distro) Name

func (d Distro) Name() string

func (Distro) String

func (d Distro) String() string

String returns a human-friendly representation of the Linux distribution.

type Type

type Type string

Type represents the different Linux distribution options

const (
	Debian       Type = "debian"
	Ubuntu       Type = "ubuntu"
	RedHat       Type = "redhat"
	CentOS       Type = "centos"
	Fedora       Type = "fedora"
	Alpine       Type = "alpine"
	Busybox      Type = "busybox"
	AmazonLinux  Type = "amazonlinux"
	OracleLinux  Type = "oraclelinux"
	ArchLinux    Type = "archlinux"
	OpenSuseLeap Type = "opensuseleap"
	SLES         Type = "sles"
	Photon       Type = "photon"
	Windows      Type = "windows"
	Mariner      Type = "mariner"
	RockyLinux   Type = "rockylinux"
	AlmaLinux    Type = "almalinux"
	Gentoo       Type = "gentoo"
	Wolfi        Type = "wolfi"
	Chainguard   Type = "chainguard"
)

func TypeFromRelease

func TypeFromRelease(release linux.Release) Type

func (Type) String

func (t Type) String() string

String returns the string representation of the given Linux distribution.

Jump to

Keyboard shortcuts

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