system

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource added in v0.15.0

type Resource struct {
	OS                 string  // 操作系统名称
	Processes          uint64  // 进程数
	IP                 string  // IP
	CpuName            string  // CPU名称
	CpuMhz             float64 // CPU总赫兹
	CpuCores           int     // CPU核心数
	CpuUsagePercent    float64 // CPU使用百分比
	MemoryTotal        uint64  // 总内存
	MemoryAvailable    uint64  // 内存可用量(B)
	MemoryUsage        uint64  // 内存已使用(B)
	MemoryUsagePercent float64 // 内存使用百分比
	DiskTotal          uint64  // 硬盘总容量
	DiskAvailable      uint64  // 硬盘可用空间
	DiskUsage          uint64  // 硬盘已用空间
	DiskUsagePercent   float64 // 硬盘使用百分比
}

func GetResource

func GetResource() Resource

GetResource 获取当前环境信息

func (*Resource) ToString added in v0.15.0

func (receiver *Resource) ToString() string

Jump to

Keyboard shortcuts

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