-
Notifications
You must be signed in to change notification settings - Fork 1
/
system.go
44 lines (40 loc) · 1.05 KB
/
system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package system
import (
"fmt"
"github.com/0x1un/go-dmidecode/smbios"
)
// Information 系统信息
type Information struct {
smbios.Header
Manufacturer string `json:"manufacturer,omitempty"`
ProductName string `json:"product_name,omitempty"`
Version string `json:"version,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
UUID string `json:"uuid,omitempty"`
WakeUpType WakeUpType `json:"wake_up_type,omitempty"`
SKUNumber string `json:"sku_number,omitempty"`
Family string `json:"family,omitempty"`
}
func (s Information) String() string {
return fmt.Sprintf("Handle %x, DMI type %d, %d bytes\n"+
"\tSystem Information\n"+
"\tManufacturer: %s\n"+
"\tProduct Name: %s\n"+
"\tVersion: %s\n"+
"\tSerial Number: %s\n"+
"\tUUID: %s\n"+
"\tWake-up Type: %s\n"+
"\tSKU Number: %s\n"+
"\tFamily: %s",
s.Header.Handle,
s.Header.Type,
s.Header.Length,
s.Manufacturer,
s.ProductName,
s.Version,
s.SerialNumber,
s.UUID,
s.WakeUpType,
s.SKUNumber,
s.Family)
}