mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
19 lines
407 B
Go
19 lines
407 B
Go
//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
|
|
}
|