Including system metadata when posting to utility API

This commit is contained in:
Cuong Manh Le
2026-04-30 19:19:19 +07:00
committed by Cuong Manh Le
parent 8b92dc97a3
commit ba3dd3a4b0
20 changed files with 374 additions and 119 deletions
+18
View File
@@ -0,0 +1,18 @@
//go:build !darwin
package system
import "github.com/jaypipes/ghw"
// GetChassisInfo retrieves hardware information including machine model type and vendor from the system profiler.
func GetChassisInfo() (*ChassisInfo, error) {
chassis, err := ghw.Chassis()
if err != nil {
return nil, err
}
info := &ChassisInfo{
Type: chassis.TypeDescription,
Vendor: chassis.Vendor,
}
return info, nil
}