Documentation
¶
Overview ¶
Package sysinfo is a Go library providing Linux OS / kernel / hardware system information.
Index ¶
Constants ¶
View Source
const Version = "1.1.3"
Version of the sysinfo library.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BIOS ¶
type BIOS struct {
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Date string `json:"date,omitempty"`
}
BIOS information.
type Board ¶
type Board struct {
Name string `json:"name,omitempty"`
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Serial string `json:"serial,omitempty"`
AssetTag string `json:"assettag,omitempty"`
}
Board information.
type CPU ¶
type CPU struct {
Vendor string `json:"vendor,omitempty"`
Model string `json:"model,omitempty"`
Speed uint `json:"speed,omitempty"` // CPU clock rate in MHz
Cache uint `json:"cache,omitempty"` // CPU cache size in KB
Cpus uint `json:"cpus,omitempty"` // number of physical CPUs
Cores uint `json:"cores,omitempty"` // number of physical CPU cores
Threads uint `json:"threads,omitempty"` // number of logical (HT) CPU cores
Governor string `json:"governor,omitempty"` // CPU frequency governor
}
CPU information.
type Chassis ¶
type Chassis struct {
Type uint `json:"type,omitempty"`
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Serial string `json:"serial,omitempty"`
AssetTag string `json:"assettag,omitempty"`
}
Chassis information.
type Kernel ¶
type Kernel struct {
Release string `json:"release,omitempty"`
Version string `json:"version,omitempty"`
Architecture string `json:"architecture,omitempty"`
}
Kernel information.
type LogicalVolume ¶
type LogicalVolume struct {
LVName string `json:"lvname,omitempty"`
VGName string `json:"vgname,omitempty"`
LVSize float64 `json:"lvsize,omitempty"`
}
LogicalVolume information.
type Memory ¶
type Memory struct {
Type string `json:"type,omitempty"`
Speed uint `json:"speed,omitempty"` // RAM data rate in MT/s
Size uint `json:"size,omitempty"` // RAM size in MB
Swap uint `json:"swap,omitempty"` // Swap size in MB
}
Memory information.
type NetworkDevice ¶
type NetworkDevice struct {
Name string `json:"name,omitempty"`
Driver string `json:"driver,omitempty"`
MACAddress string `json:"macaddress,omitempty"`
IPAddress []string `json:"ipaddress,omitempty"`
Port string `json:"port,omitempty"`
Speed uint `json:"speed,omitempty"` // device max supported speed in Mbps
MTU int `json:"mtu,omitempty"`
}
NetworkDevice information.
type Node ¶
type Node struct {
Hostname string `json:"hostname,omitempty"`
MachineID string `json:"machineid,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
Timezone string `json:"timezone,omitempty"`
}
Node information.
type OS ¶
type OS struct {
Name string `json:"name,omitempty"`
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Release string `json:"release,omitempty"`
Architecture string `json:"architecture,omitempty"`
}
OS information.
type Product ¶
type Product struct {
Name string `json:"name,omitempty"`
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Serial string `json:"serial,omitempty"`
UUID uuid.UUID `json:"uuid,omitempty"`
SKU string `json:"sku,omitempty"`
}
Product information.
type StorageDevice ¶
type StorageDevice struct {
Name string `json:"name,omitempty"`
Driver string `json:"driver,omitempty"`
Vendor string `json:"vendor,omitempty"`
Model string `json:"model,omitempty"`
Serial string `json:"serial,omitempty"`
Size uint `json:"size,omitempty"` // device size in GB
}
StorageDevice information.
type SysInfo ¶
type SysInfo struct {
Node Node `json:"node,omitempty"`
OS OS `json:"os,omitempty"`
Kernel Kernel `json:"kernel,omitempty"`
Product Product `json:"product,omitempty"`
Board Board `json:"board,omitempty"`
Chassis Chassis `json:"chassis,omitempty"`
BIOS BIOS `json:"bios,omitempty"`
CPU CPU `json:"cpu,omitempty"`
Memory Memory `json:"memory,omitempty"`
Storage []StorageDevice `json:"storage,omitempty"`
LVM []LogicalVolume `json:"lvm,omitempty"`
Network []NetworkDevice `json:"network,omitempty"`
}
SysInfo struct encapsulates all other information structs.
func (*SysInfo) GetSysInfo ¶
func (si *SysInfo) GetSysInfo()
GetSysInfo gathers all available system information.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sysinfo
command
sysinfo is a very simple utility demonstrating sysinfo library capabilities.
|
sysinfo is a very simple utility demonstrating sysinfo library capabilities. |
|
Package cpuid gives Go programs access to CPUID opcode.
|
Package cpuid gives Go programs access to CPUID opcode. |
Click to show internal directories.
Click to hide internal directories.