Documentation ¶
Overview ¶
Package sysinfo is a Go library providing Linux OS / kernel / hardware system information.
Index ¶
Constants ¶
View Source
const Version = "0.9.5"
Version of the sysinfo library.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BIOS ¶
type BIOS struct { Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Date string `json:"date,omitempty" cty:"date" hcl:"date,optional"` }
BIOS information.
type Board ¶
type Board struct { Name string `json:"name,omitempty" cty:"name" hcl:"name,optional"` Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Serial string `json:"serial,omitempty" cty:"serial" hcl:"serial,optional"` AssetTag string `json:"assettag,omitempty" cty:"assettag" hcl:"assettag,optional"` }
Board information.
type CPU ¶
type CPU struct { Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Model string `json:"model,omitempty" cty:"model" hcl:"model,optional"` Speed uint `json:"speed,omitempty" cty:"speed" hcl:"speed,optional"` // CPU clock rate in MHz Cache uint `json:"cache,omitempty" cty:"cache" hcl:"cache,optional"` // CPU cache size in KB Cpus uint `json:"cpus,omitempty" cty:"cpus" hcl:"cpus,optional"` // number of physical CPUs Cores uint `json:"cores,omitempty" cty:"cores" hcl:"cores,optional"` // number of physical CPU cores Threads uint `json:"threads,omitempty" cty:"threads" hcl:"threads,optional"` // number of logical (HT) CPU cores }
CPU information.
type Chassis ¶
type Chassis struct { Type uint `json:"type,omitempty" cty:"type" hcl:"type,optional"` Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Serial string `json:"serial,omitempty" cty:"serial" hcl:"serial,optional"` AssetTag string `json:"assettag,omitempty" cty:"assettag" hcl:"assettag,optional"` }
Chassis information.
type Kernel ¶
type Kernel struct { Release string `json:"release,omitempty" cty:"release" hcl:"release,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Architecture string `json:"architecture,omitempty" cty:"architecture" hcl:"architecture,optional"` }
Kernel information.
type Memory ¶
type Memory struct { Type string `json:"type,omitempty" cty:"type" hcl:"type,optional"` Speed uint `json:"speed,omitempty" cty:"speed" hcl:"speed,optional"` // RAM data rate in MT/s Size uint `json:"size,omitempty" cty:"size" hcl:"size,optional"` // RAM size in MB }
Memory information.
type Meta ¶
type Meta struct { Version string `json:"version" cty:"version" hcl:"version,optional"` Timestamp time.Time `json:"timestamp" cty:"timestamp" hcl:"timestamp,optional"` }
Meta information.
type NetworkDevice ¶
type NetworkDevice struct { Name string `json:"name,omitempty" cty:"name" hcl:"name,optional"` Driver string `json:"driver,omitempty" cty:"driver" hcl:"driver,optional"` MACAddress string `json:"macaddress,omitempty" cty:"macaddress" hcl:"macaddress,optional"` Port string `json:"port,omitempty" cty:"port" hcl:"port,optional"` Speed uint `json:"speed,omitempty" cty:"speed" hcl:"speed,optional"` // device max supported speed in Mbps }
NetworkDevice information.
type Node ¶
type Node struct { Hostname string `json:"hostname,omitempty" cty:"hostname" hcl:"hostname,optional"` MachineID string `json:"machineid,omitempty" cty:"machineid" hcl:"machineid,optional"` Hypervisor string `json:"hypervisor,omitempty" cty:"hypervisor" hcl:"hypervisor,optional"` Timezone string `json:"timezone,omitempty" cty:"timezone" hcl:"timezone,optional"` }
Node information.
type OS ¶
type OS struct { Name string `json:"name,omitempty" cty:"name" hcl:"name,optional"` Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Release string `json:"release,omitempty" cty:"release" hcl:"release,optional"` Architecture string `json:"architecture,omitempty" cty:"architecture" hcl:"architecture,optional"` }
OS information.
type Product ¶
type Product struct { Name string `json:"name,omitempty" cty:"name" hcl:"name,optional"` Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Version string `json:"version,omitempty" cty:"version" hcl:"version,optional"` Serial string `json:"serial,omitempty" cty:"serial" hcl:"serial,optional"` }
Product information.
type StorageDevice ¶
type StorageDevice struct { Name string `json:"name,omitempty" cty:"name" hcl:"name,optional"` Driver string `json:"driver,omitempty" cty:"driver" hcl:"driver,optional"` Vendor string `json:"vendor,omitempty" cty:"vendor" hcl:"vendor,optional"` Model string `json:"model,omitempty" cty:"model" hcl:"model,optional"` Serial string `json:"serial,omitempty" cty:"serial" hcl:"serial,optional"` Size uint `json:"size,omitempty" cty:"size" hcl:"size,optional"` // device size in GB }
StorageDevice information.
type SysInfo ¶
type SysInfo struct { Meta Meta `json:"sysinfo" cty:"sysinfo" hcl:"sysinfo,block"` Node Node `json:"node" cty:"node" hcl:"node,block"` OS OS `json:"os" cty:"os" hcl:"os,block"` Kernel Kernel `json:"kernel" cty:"kernel" hcl:"kernel,block"` Product Product `json:"product" cty:"product" hcl:"product,block"` Board Board `json:"board" cty:"board" hcl:"board,block"` Chassis Chassis `json:"chassis" cty:"chassis" hcl:"chassis,block"` BIOS BIOS `json:"bios" cty:"bios" hcl:"bios,block"` CPU CPU `json:"cpu" cty:"cpu" hcl:"cpu,block"` Memory Memory `json:"memory" cty:"memory" hcl:"memory,block"` Storage []StorageDevice `json:"storage,omitempty" cty:"storage" hcl:"storage,block"` Network []NetworkDevice `json:"network,omitempty" cty:"network" hcl:"network,block"` }
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
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.