diskKit

package
v2.1.35 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskStat

type DiskStat struct {
	*disk.UsageStat

	Path string `json:"path"`
}

DiskStat

Total = Used + Free

func GetDiskStat

func GetDiskStat() (*DiskStat, error)

GetDiskStat

PS: (1) Mac(Linux),查看磁盘空间的命令: df -h

golang 获取cpu 内存 硬盘 使用率 信息 进程信息

https://blog.csdn.net/whatday/article/details/109620192

func (*DiskStat) GetFreePercent

func (stat *DiskStat) GetFreePercent() float64

GetFreePercent

@return e.g. 46.2685870725817

func (*DiskStat) GetUsedPercent

func (stat *DiskStat) GetUsedPercent() float64

GetUsedPercent

@return e.g. 53.7314129274183

func (*DiskStat) String

func (stat *DiskStat) String() string

String

e.g. Mac "path: /, free: 213 GiB, used: 247 GiB, total: 460 GiB, free percent: 46.27%" e.g.1 Windows "path: C:, free: 93 GiB, used: 145 GiB, total: 237 GiB, free percent: 39.05%"

Jump to

Keyboard shortcuts

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