-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
60 lines (54 loc) · 2.35 KB
/
structs.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package kramer
import (
"encoding/xml"
)
// command: Struct used to build the XML commands that need to be sent to the VIA
type command struct {
XMLName xml.Name `xml:"P"`
Username string `xml:"UN"`
Password string `xml:"Pwd"`
Command string `xml:"Cmd"`
Param1 string `xml:"P1,omitempty"`
Param2 string `xml:"P2,omitempty"`
Param3 string `xml:"P3,omitempty"`
Param4 string `xml:"P4,omitempty"`
Param5 string `xml:"P5,omitempty"`
Param6 string `xml:"P6,omitempty"`
Param7 string `xml:"P7,omitempty"`
Param8 string `xml:"P8,omitempty"`
Param9 string `xml:"P9,omitempty"`
Param10 string `xml:"P10,omitempty"`
}
// HardwareInfo contains the common information for device hardware information
type HardwareInfo struct {
Hostname string `json:"hostname,omitempty"`
ModelName string `json:"model_name,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
BuildDate string `json:"build_date,omitempty"`
FirmwareVersion string `json:"firmware_version,omitempty"`
ProtocolVersion string `json:"protocol_version,omitempty"`
NetworkInfo NetworkInfo `json:"network_information,omitempty"`
FilterStatus string `json:"filter_status,omitempty"`
WarningStatus []string `json:"warning_status,omitempty"`
ErrorStatus []string `json:"error_status,omitempty"`
PowerStatus string `json:"power_status,omitempty"`
PowerSavingModeStatus string `json:"power_saving_mode_status,omitempty"`
TimerInfo []map[string]int `json:"timer_info,omitempty"`
Temperature string `json:"temperature,omitempty"`
}
// NetworkInfo contains the network information for the device
type NetworkInfo struct {
IPAddress string `json:"ip_address,omitempty"`
MACAddress string `json:"mac_address,omitempty"`
Gateway string `json:"gateway,omitempty"`
DNS []string `json:"dns,omitempty"`
}
// VIAUsers contains the counts of the users logged in to the VIA and their status
type VIAUsers struct {
InactiveUsers []string `json:"inactive_users"`
ActiveUsers []string `json:"active_users"`
UsersWaiting []string `json:"users_waiting"`
}
type ActiveSignal struct {
Active bool `json:"active"`
}