sk-matrix-project/app/wails/lib/system/system.go

31 lines
617 B
Go
Raw Normal View History

2023-07-09 23:04:17 +08:00
package system
import (
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/net"
)
type InfoUtils struct {
}
func (i *InfoUtils) GetCpuInfo() []cpu.InfoStat {
return GetCpuInfo()
}
func (i *InfoUtils) GetDiskPartitions() []disk.PartitionStat {
return GetDiskPartitions()
}
func (i *InfoUtils) GetDiskUsage(diskPath string) *disk.UsageStat {
return GetDiskUsage(diskPath)
}
func (i *InfoUtils) ScanDir(path string) ([]*FileEntry, error) {
return ScanDir(path)
}
func (i *InfoUtils) GetNetWorkConnection() []net.ConnectionStat {
return GetNetWorkConnection()
}