Documentation
¶
Overview ¶
Package platform is how a collector picks its variant: Detect is the host's family, as pkg/gohai/family names it, and a test swaps it to force any branch without reading the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Detect = family.Detect
Detect returns the host's family: darwin on macOS, a family such as debian, rhel, fedora or amazon on Linux, the platform itself for a Linux host without a family, or "" when the host could not be read. Collectors dispatch on it:
switch platform.Detect() {
case family.Darwin: return NewDarwin()
case family.Debian: return NewDebian()
default: return NewLinux()
}
Tests override it:
orig := platform.Detect
defer func() { platform.Detect = orig }()
platform.Detect = func() string { return "darwin" }
Functions ¶
Types ¶
This section is empty.