Documentation
¶
Overview ¶
Package osdetect provides operating system detection and information
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackageInstallCommand ¶
GetPackageInstallCommand returns the command to install a package
func GetSSHConfigPath ¶
GetSSHConfigPath returns the SSH config file path
func GetServiceRestartCommand ¶
GetServiceRestartCommand returns the command to restart a service
func GetUserHomeDir ¶
GetUserHomeDir returns the home directory path based on OS
Types ¶
type DistroType ¶
type DistroType string
DistroType represents the distribution type
const ( // Debian represents Debian-based distributions (Debian, Ubuntu, etc.) Debian DistroType = "debian" // RedHat represents Red Hat-based distributions (RHEL, CentOS, Fedora, etc.) RedHat DistroType = "redhat" // SUSE represents SUSE-based distributions (SUSE, openSUSE, etc.) SUSE DistroType = "suse" // Arch represents Arch-based distributions (Arch Linux, Manjaro, etc.) Arch DistroType = "arch" // Generic represents a generic Linux distribution Generic DistroType = "generic" // MacOS represents macOS MacOS DistroType = "macos" // UnknownDistro represents an unknown distribution UnknownDistro DistroType = "unknown" )
type Info ¶
type Info struct {
// Type is the operating system type (Linux, Darwin, etc.)
Type OSType
// Distro is the distribution type (Debian, RedHat, MacOS, etc.)
Distro DistroType
// Version is the operating system version
Version string
// PlatformID is the platform identifier
PlatformID string
// PackageManager is the package manager type
PackageManager PackageManager
}
Info contains information about the operating system
type PackageManager ¶
type PackageManager string
PackageManager represents the package manager type
const ( // APT represents the APT package manager (Debian, Ubuntu, etc.) APT PackageManager = "apt" // DNF represents the DNF package manager (Fedora, etc.) DNF PackageManager = "dnf" // YUM represents the YUM package manager (RHEL, CentOS, etc.) YUM PackageManager = "yum" // Zypper represents the Zypper package manager (SUSE, openSUSE, etc.) Zypper PackageManager = "zypper" // Pacman represents the Pacman package manager (Arch Linux, Manjaro, etc.) Pacman PackageManager = "pacman" // Brew represents the Homebrew package manager (macOS) Brew PackageManager = "brew" // UnknownPM represents an unknown package manager UnknownPM PackageManager = "unknown" )
Click to show internal directories.
Click to hide internal directories.