Documentation ¶
Index ¶
- Constants
- Variables
- func BootTime() (t time.Time, err error)
- func CPUUsage(maxCores int) (out []float64)
- func FreeAndUsedDiskSpace() (free int64, used int64)
- func HardwareTypeAndVersion() (string, float32)
- func InitNetworkBandwidth()
- func IsDesktop() bool
- func MACAddress() ([]byte, error)
- func MemoryAvailableUsedAndTotal() (available int64, used int64, total int64)
- func Model() string
- func Name() string
- func NetworkBandwidthPerSec() (map[string]NetIO, error)
- func NetworkTraffic() (map[string]NetIO, error)
- func OSVersion() string
- func OSVersionNumber() float64
- func UUID() string
- type ArchitectureType
- type BrowserType
- type CellularNetworkType
- type NetCount
- type NetIO
- type OSType
Constants ¶
View Source
const ( CellularUnknown CellularNetworkType = iota CellularWifiMax Cellular2G Cellular3G Cellular4G Cellular5G CellularXG MacOSType OSType = "macos" IOSType OSType = "ios" AndroidType OSType = "android" WindowsType OSType = "windows" LinuxType OSType = "linux" WebType OSType = "web" NoneOSType OSType = "" ARM64Type ArchitectureType = "arm64" AMD64Type ArchitectureType = "amd64" WASMType ArchitectureType = "wasm" ArchitectureTypeNone ArchitectureType = "" )
Variables ¶
View Source
var (
OverrideUUID string // used for unit tests and other testing that needs a know uuid
)
Functions ¶
func CPUUsage ¶
CPUUsage returns a slice of 0-1 where 1 is 100% of how much each CPU is utilized. Order unknown, but hopefully doesn't change if more than maxCores, it is recursivly halved, summing first half with last
func FreeAndUsedDiskSpace ¶
func HardwareTypeAndVersion ¶
func InitNetworkBandwidth ¶
func InitNetworkBandwidth()
func MACAddress ¶
GetMACAddress returns the MAC address as 6 bytes.
func NetworkBandwidthPerSec ¶
NetworkBandwidthPerSec returns bytes pr sec/in out, and error/drop count pr sec all 0 if not sampled yet
func NetworkTraffic ¶
NetworkTraffic returns a map of interface-name to In/Out bytes/drops/errors
func OSVersionNumber ¶
func OSVersionNumber() float64
Types ¶
type ArchitectureType ¶
type ArchitectureType string
func Architecture ¶
func Architecture() ArchitectureType
Architecture returns the main type of CPU used, ARM, AMD64, WASM
type BrowserType ¶
type BrowserType string
const ( Safari BrowserType = "safari" Chrome BrowserType = "chrome" Edge BrowserType = "edge" Firefox BrowserType = "firefox" Default BrowserType = "default" BrowserNone BrowserType = "" )
func WasmBrowser ¶
func WasmBrowser() BrowserType
type CellularNetworkType ¶
type CellularNetworkType int
Click to show internal directories.
Click to hide internal directories.