release

package
v0.0.0-...-8a2d87d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: GPL-3.0 Imports: 6 Imported by: 398

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OnClassic bool

OnClassic states whether the process is running inside a classic Ubuntu system or a native Ubuntu Core image.

View Source
var OnCoreDesktop bool

OnCoreDesktop states whether the process is running inside a Core Desktop image.

View Source
var OnWSL bool

OnWSL states whether the process is running inside the Windows Subsystem for Linux

View Source
var Series = "16"

Series holds the Ubuntu Core series for snapd to use.

View Source
var WSLVersion int

If the previous is true, WSLVersion states whether the process is running inside WSL1 or WSL2 Otherwise it is set to 0

Functions

func DistroLike

func DistroLike(distros ...string) bool

DistroLike checks if the distribution ID or ID_LIKE matches one of the given names.

func MockOnClassic

func MockOnClassic(onClassic bool) (restore func())

MockOnClassic forces the process to appear inside a classic Ubuntu system or a native image for testing purposes.

func MockOnCoreDesktop

func MockOnCoreDesktop(onCoreDesktop bool) (restore func())

MockOnCoreDesktop forces the process to appear inside a core desktop system for testing purposes.

func MockReleaseInfo

func MockReleaseInfo(osRelease *OS) (restore func())

MockReleaseInfo fakes a given information to appear in ReleaseInfo, as if it was read /etc/os-release on startup.

func SystemctlSupportsUserUnits

func SystemctlSupportsUserUnits() bool

SystemctlSupportsUserUnits returns true if the systemctl utility supports user units.

Types

type OS

type OS struct {
	ID        string   `json:"id"`
	IDLike    []string `json:"-"`
	VariantID string   `json:"variant-id,omitempty"`
	VersionID string   `json:"version-id,omitempty"`
}

OS contains information about the system extracted from /etc/os-release.

var ReleaseInfo OS

ReleaseInfo contains data loaded from /etc/os-release on startup.

Jump to

Keyboard shortcuts

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