mirror of
https://github.com/jkstack/libagent.git
synced 2025-12-24 12:11:57 +08:00
22 lines
425 B
Go
22 lines
425 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package hostinfo
|
|
|
|
import "github.com/shirou/gopsutil/v3/host"
|
|
|
|
// Info host info
|
|
func Info() (*InfoStat, error) {
|
|
info, err := host.Info()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &InfoStat{
|
|
OS: info.OS,
|
|
Platform: info.Platform,
|
|
PlatformVersion: info.PlatformVersion,
|
|
KernelVersion: info.KernelVersion,
|
|
KernelArch: info.KernelArch,
|
|
}, nil
|
|
}
|