osinfo

package
v7.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineLinuxDistroVersion

func DetermineLinuxDistroVersion(distro Distro, release string) string

DetermineLinuxDistroVersion returns the distribution release version from the image.release value.

func DetermineOS

func DetermineOS(imageOS string) (OSType, Distro)

DetermineOS returns the OS type from the image.os value.

func DetermineOSDetails

func DetermineOSDetails(imageOS, imageRelease string) (OSType, Distro, string)

DetermineOSDetails returns the OS type, distribution, and version from the given image.os and image.release values.

func GetOSQemuCompatibility

func GetOSQemuCompatibility(osType OSType, distro Distro, distroVersion string) (bool, bool, []string)

GetOSQemuCompatibility returns whether the given OS details support various modern qemu features.

func MapWindowsVersionToAbbrev

func MapWindowsVersionToAbbrev(version string) (string, error)

MapWindowsVersionToAbbrev takes a full version string and returns the abbreviation used by virtio-win drivers.

func ToWindowsVersion

func ToWindowsVersion(imageRelease string) (string, error)

ToWindowsVersion returns the windows version for the given OS description.

func ValidateWindowsVersion

func ValidateWindowsVersion(v string) error

ValidateWindowsVersion checks if the given Windows version is valid.

Types

type Distro

type Distro string

Distro represents an OS distribution.

const (
	// AlmaLinux represents an Alma Linux distribution.
	AlmaLinux Distro = "alma"
	// AmazonLinux represents an Amazon Linux distribution.
	AmazonLinux Distro = "amazon"
	// ArchLinux represents an Arch Linux distribution.
	ArchLinux Distro = "arch"
	// CentOSLinux represents a CentOS Linux distribution.
	CentOSLinux Distro = "centos"
	// DebianLinux represents a Debian Linux distribution.
	DebianLinux Distro = "debian"
	// FedoraLinux represents a Fedora Linux distribution.
	FedoraLinux Distro = "fedora"
	// OracleLinux represents an Oracle Linux distribution.
	OracleLinux Distro = "oracle"
	// RedHatLinux represents a RedHat Enterprise Linux distribution.
	RedHatLinux Distro = "rhel"
	// RockyLinux represents a Rocky Linux distribution.
	RockyLinux Distro = "rocky"
	// SUSELinux represents OpenSUSE/SLES Linux distributions.
	SUSELinux Distro = "suse"
	// UbuntuLinux represents an Ubuntu Linux distribution.
	UbuntuLinux Distro = "ubuntu"

	// OtherDistro represents all other distributions, or OSTypes without a distribution concept.
	OtherDistro Distro = "other"
)

func DetermineLinuxDistro

func DetermineLinuxDistro(imageOS string) Distro

DetermineLinuxDistro returns the Linux distribution from the image.os value.

func (Distro) IsRHELDerivative

func (d Distro) IsRHELDerivative() bool

IsRHELDerivative returns whether the given distro is a RHEL derivative.

type OSType

type OSType string

OSType represents an OS type (windows, linux, macos, bsd).

const (
	// Windows represents the Windows OS type.
	Windows OSType = "windows"
	// Linux represents the Linux OS type.
	Linux OSType = "linux"
	// FreeBSD represents the FreeBSD OS type.
	FreeBSD OSType = "freebsd"
	// MacOS represents the macOS OS type.
	MacOS OSType = "macos"
	// UnknownOS represents all other OS types.
	UnknownOS OSType = "unknown"
)

Jump to

Keyboard shortcuts

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