增加获取磁盘挂载点接口

This commit is contained in:
Sun
2024-01-05 21:36:38 +08:00
parent 21e8e8f1b8
commit c955afd861
3 changed files with 16 additions and 2 deletions
+4
View File
@@ -97,6 +97,10 @@ func GetDiskInfo() ([]DiskInfo, error) {
return disks, nil
}
func GetDiskMountpoints() ([]disk.PartitionStat, error) {
return disk.Partitions(true)
}
func GetDiskInfoByPath(path string) (*DiskInfo, error) {
diskInfo := DiskInfo{}
usage, err := disk.Usage(path)