forked from zcalusic/sysinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard.go
22 lines (19 loc) · 779 Bytes
/
board.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
package sysinfo
// Board information.
type Board struct {
Name string `json:"name,omitempty"`
Vendor string `json:"vendor,omitempty"`
Version string `json:"version,omitempty"`
Serial string `json:"serial,omitempty"`
AssetTag string `json:"assettag,omitempty"`
}
func (si *SysInfo) getBoardInfo() {
si.Board.Name = slurpFile("/sys/class/dmi/id/board_name")
si.Board.Vendor = slurpFile("/sys/class/dmi/id/board_vendor")
si.Board.Version = slurpFile("/sys/class/dmi/id/board_version")
si.Board.Serial = slurpFile("/sys/class/dmi/id/board_serial")
si.Board.AssetTag = slurpFile("/sys/class/dmi/id/board_asset_tag")
}