[ Cmii ] [ Octopus ] - reformat agent-go - 1
This commit is contained in:
22
agent-go/a_status/Host.go
Normal file
22
agent-go/a_status/Host.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user