sys_info

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentSysInfo = &SysInfo{}

Functions

This section is empty.

Types

type CpuInfo

type CpuInfo struct {
	SocketAt         int             `json:"socket_at"` // cpu 插槽
	Brand            brandFlag.Brand `json:"brand"`     // 厂商品牌
	Class            string          `json:"class"`     // 系列分类
	ClassRd          int64           `json:"class_rd"`  // 系列分类代数
	Cores            int64
	Threads          int64
	ModelName        string  `json:"model_name"`      // CPU 型号
	FrequencyMainMHz float64 `json:"frequency_main"`  // CPU 主频 单位MHz
	Percentage       float64 `json:"percentage"`      // 使用率
	PercentageShow   string  `json:"percentage_show"` //使用率显示
}

type DiskInfo

type DiskInfo struct {
	Partitions []MountInfo
}

type GpuInfo

type GpuInfo struct {
}

type MemoryInfo

type MemoryInfo struct {
	Total     uint64
	TotalShow string
	Used      uint64

	UsedPercent     float64
	UsedPercentShow string
	Free            uint64
	FreeShow        string
	// contains filtered or unexported fields
}

type MountInfo

type MountInfo struct {
	Path      string
	Partition disk.PartitionStat
	Usage     disk.UsageStat
}

type NetInfo

type NetInfo struct {
	Stat []net.IOCountersStat
}

type SysInfo

type SysInfo struct {
	CpuInfos   map[string]CpuInfo `json:"cpu"`
	MemoryInfo MemoryInfo         `json:"mem"`
	DiskInfo   DiskInfo           `json:"disk"`
	NetInfo    NetInfo            `json:"net"`
	Host       host.InfoStat      `json:"host"`
}

func RefreshSysInfos

func RefreshSysInfos() (*SysInfo, error)

Jump to

Keyboard shortcuts

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