winsysinfo

package
v0.0.0-...-298ae05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sysinfo is a pure Go library providing Linux OS / kernel / hardware system information.

Index

Constants

View Source
const Version = "0.9.2"

Version of the sysinfo library.

Variables

This section is empty.

Functions

This section is empty.

Types

type BIOS

type BIOS struct {
	Serial  string `json:"serial,omitempty"`
	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
	ProcessorId string `json:"processorid,omitempty"`
}

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 Host

type Host struct {
	MachineID    string `json:"machineid,omitempty"`
	Architecture string `json:"architecture,omitempty"`
	Hypervisor   string `json:"hypervisor,omitempty"`
}

type Kernel

type Kernel struct {
	Release      string `json:"release,omitempty"`
	Version      string `json:"version,omitempty"`
	Architecture string `json:"architecture,omitempty"`
}

Kernel 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
	Vendor string `json:"vendor,omitempty"`
}

Memory information.

type Meta

type Meta struct {
	Version   string    `json:"version"`
	Timestamp time.Time `json:"timestamp"`
}

Meta information.

type NetworkDevice

type NetworkDevice struct {
	Name       string `json:"name,omitempty"`
	Driver     string `json:"driver,omitempty"`
	MACAddress string `json:"macaddress,omitempty"`
	Speed      uint   `json:"speed,omitempty"` // device max supported speed in Mbps
	Vendor     string `json:"vendor,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"`
}

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"`
	Serial       string `json:"serial,omitempty"`
	HostName     string `json:"host_name,omitempty"`
	Timezone     string `json:"timezone,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"`
}

Product information.

type SysInfo

type SysInfo struct {
	Meta    Meta            `json:"sysinfo"`
	OS      OS              `json:"os"`
	Kernel  Kernel          `json:"kernel"`
	Product Product         `json:"product"`
	Board   Board           `json:"board"`
	Node    Node            `json:"node"`
	Chassis Chassis         `json:"chassis"`
	BIOS    BIOS            `json:"bios"`
	CPU     CPU             `json:"cpu"`
	Memory  Memory          `json:"memory"`
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL