Documentation ¶
Index ¶
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskInfo ¶
type DiskInfo struct { Path string `json:"path"` //挂着点 Device string `json:"device"` //设备名称 Fstype string `json:"fstype"` //文件系统类型 Total uint64 `json:"total"` //总计大小(MB) Free uint64 `json:"free"` //剩余大小(MB) Used uint64 `json:"used"` //已使用大小(MB) UsedPercent float64 `json:"usedPercent"` //使用率 InodesTotal uint64 `json:"inodesTotal"` //inode统计大小 InodesUsed uint64 `json:"inodesUsed"` //inode已使用大小 InodesFree uint64 `json:"inodesFree"` //inode剩余大小 InodesUsedPercent float64 `json:"inodesUsedPercent"` //inode使用率 LastTime string `json:"lastTime"` //采集时间 }
func GetAllDiskInfo ¶
GetAllDiskInfo Partitions returns disk partitions. If all is false, returns physical devices only (e.g. hard disks, cd-rom drives, USB keys) and ignore all others (e.g. memory partitions such as /dev/shm)
func GetAllPhysicalDiskInfo ¶
func GetAllPhysicalDiskInfo() []*DiskInfo
GetAllDiskInfo 获取所有物理磁盘信息 Partitions returns disk partitions. If all is false, returns physical devices only (e.g. hard disks, cd-rom drives, USB keys) and ignore all others (e.g. memory partitions such as /dev/shm)
func NewDiskInfo ¶
func NewDiskInfo() *DiskInfo
Click to show internal directories.
Click to hide internal directories.