sysinfo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INC_HOSTNAME = iota
	INC_PLATFORM
	INC_CPU
	INC_MEM
	INC_DISK
	INC_MACADDR
)

Variables

This section is empty.

Functions

func ContainsInt

func ContainsInt(slice []int, item int) bool

func GetMACAddr

func GetMACAddr() (string, error)

Types

type CPUInfo

type CPUInfo struct {
	Threads      int32   `json:"threads,omitempty"`
	CurrentUsage float64 `json:"currentusage,omitempty"`
	Name         string  `json:"name,omitempty"`
}

CPUInfo saves the CPU information

type DiskInfo

type DiskInfo struct {
	SysID string `json:"sysid,omitempty"`
	Path  string `json:"path,omitempty"`
	Total uint64 `json:"total,omitempty"`
	Used  uint64 `json:"used,omitempty"`
	Free  uint64 `json:"free,omitempty"`
}

DiskInfo saves the Disk information

type RAMInfo

type RAMInfo struct {
	Total uint64 `json:"total,omitempty"`
	Used  uint64 `json:"used,omitempty"`
	Free  uint64 `json:"free,omitempty"`
}

RAMInfo saves the RAM information

type SysInfo

type SysInfo struct {
	Hostname string   `json:"hostname,omitempty"`
	Platform string   `json:"platform,omitempty"`
	CPU      CPUInfo  `json:"cpu,omitempty"`
	RAM      RAMInfo  `json:"ram,omitempty"`
	Disk     DiskInfo `json:"disk,omitempty"`
	MacAddr  string   `json:"macaddr,omitempty"`
}

SysInfo saves the basic system information

func GetSysInfo

func GetSysInfo(include []int) *SysInfo

func (*SysInfo) FromJson

func (s *SysInfo) FromJson(jdata []byte) *SysInfo

func (*SysInfo) ToJSON

func (s *SysInfo) ToJSON() []byte

Jump to

Keyboard shortcuts

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