linux

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DMIInfo

type DMIInfo struct {
	// ProductName of the device, as read from /sys/class/dmi/id/product_name.
	// Eg: "21J50013US".
	ProductName string

	// ProductSerial of the device, as read from /sys/class/dmi/id/product_serial.
	// Eg: "PF0A0AAA".
	ProductSerial string

	// BoardSerial of the device, as read from /sys/class/dmi/id/board_serial.
	// Eg: "L1AA00A00A0".
	BoardSerial string

	// ChassisAssetTag of the device, as read from
	// /sys/class/dmi/id/chassis_asset_tag.
	//
	// May contain a variety of strings to denote an unset asset tag, such as
	// "No Asset Information", "Default string", etc (creativity is the limit,
	// really).
	//
	// Eg: "No Asset Information".
	ChassisAssetTag string
}

DMIInfo holds information acquired from the device's DMI.

func DMIInfoFromFS

func DMIInfoFromFS(dmifs fs.FS) (*DMIInfo, error)

DMIInfoFromFS reads DMI from dmifs as if it was rooted at /sys/class/dmi/id/.

The method reads as much information as possible, so it always returns a non-nil DMIInfo, even if it errors.

func DMIInfoFromSysfs

func DMIInfoFromSysfs() (*DMIInfo, error)

DMIInfoFromSysfs reads DMI info from /sys/class/dmi/id/.

The method reads as much information as possible, so it always returns a non-nil DMIInfo, even if it errors.

type OSRelease

type OSRelease struct {
	PrettyName string
	Name       string
	VersionID  string
	Version    string
	ID         string
}

OSRelease represents the information contained in the /etc/os-release file.

func ParseOSRelease

func ParseOSRelease() (*OSRelease, error)

ParseOSRelease reads the /etc/os-release contents.

func ParseOSReleaseFromReader

func ParseOSReleaseFromReader(in io.Reader) (*OSRelease, error)

ParseOSReleaseFromReader reads an /etc/os-release data stream from in.

Jump to

Keyboard shortcuts

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