[ Cmii ] [ Octopus ] - reformat agent-go - 1

This commit is contained in:
zeaslity
2024-03-29 11:39:14 +08:00
parent aa4412f042
commit 1be48aaac2
52 changed files with 683 additions and 557 deletions

22
agent-go/a_status/Host.go Normal file
View File

@@ -0,0 +1,22 @@
package a_status
import (
"github.com/shirou/gopsutil/v3/host"
)
type HostInfo struct {
host.InfoStat
}
func GetHostInfo() (*HostInfo, error) {
info, err := host.Info()
if err != nil {
log.ErrorF("get host info error => %v", err)
return nil, err
}
return &HostInfo{
InfoStat: *info,
}, nil
}