31 lines
617 B
Go
31 lines
617 B
Go
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()
|
|
}
|