Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CPU ¶
type CPU struct { Vendor string `json:"vendor"` Model string `json:"model"` Cpus uint `json:"cpus"` // number of physical CPUs Cores uint `json:"cores"` // number of physical CPU cores Threads uint `json:"threads"` // number of logical (HT) CPU cores }
CPU information.
func (*CPU) JSONString ¶
func (*CPU) YAMLString ¶
type Memory ¶
type Memory struct {
Total uint64 `json:"total"`
}
Memory information.
func (*Memory) JSONString ¶
func (*Memory) YAMLString ¶
type Network ¶
type Network struct { NetworkInferface []NetworkInferface `json:"network_inferface"` NetworkDevice []NetworkDevice `json:"network_device"` }
func (*Network) JSONString ¶
func (*Network) YAMLString ¶
type NetworkDevice ¶
type NetworkInferface ¶
type OS ¶
type OS struct { Name string `json:"name"` Vendor string `json:"vendor"` Version string `json:"version"` Architecture string `json:"architecture"` Kernel string `json:"kernel"` }
OS information.
func (*OS) JSONString ¶
func (*OS) YAMLString ¶
type SystemInfo ¶
type SystemInfo struct { OS *OS `json:"os"` CPU *CPU `json:"cpu"` Memory *Memory `json:"memory"` Network *Network `json:"network"` }
func GetSystemInfo ¶
func GetSystemInfo() (*SystemInfo, error)
func (*SystemInfo) JSONString ¶
func (i *SystemInfo) JSONString(indent bool) string
JSONString returns a string with the host information formatted as JSON under a top-level "host:" key
func (*SystemInfo) YAMLString ¶
func (i *SystemInfo) YAMLString() string
YAMLString returns a string with the host information formatted as YAML under a top-level "host:" key
Click to show internal directories.
Click to hide internal directories.