linux

package
v1.99.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalOsRelease

func UnmarshalOsRelease(osReleaseContents []byte, release *OsRelease) error

Types

type OsRelease

type OsRelease struct {
	AnsiColor    string `osr:"ANSI_COLOR"`
	Name         string `osr:"NAME"`
	Version      string `osr:"VERSION"`
	Variant      string `osr:"VARIANT"`
	VariantID    string `osr:"VARIANT_ID"`
	ID           OsType `osr:"ID"`
	IDLike       string `osr:"ID_LIKE"`
	PrettyName   string `osr:"PRETTY_NAME"`
	VersionID    string `osr:"VERSION_ID"`
	HomeURL      string `osr:"HOME_URL"`
	SupportURL   string `osr:"SUPPORT_URL"`
	BugReportURL string `osr:"BUG_REPORT_URL"`
}

OsRelease reflects values in /etc/os-release Values in this struct must always be string or the reflection will not work properly.

func GetOsRelease

func GetOsRelease() (*OsRelease, error)

func (*OsRelease) GetIDLike

func (osr *OsRelease) GetIDLike() []OsType

type OsType

type OsType string

Enum the Distro ID

const (
	RHEL   OsType = "rhel"
	Fedora OsType = "fedora"
	CentOS OsType = "centos"
	Ubuntu OsType = "ubuntu"
)

Jump to

Keyboard shortcuts

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