-
Notifications
You must be signed in to change notification settings - Fork 0
/
yamlReadTypes.go
157 lines (135 loc) · 6.04 KB
/
yamlReadTypes.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
package config
type configRead struct {
Version *int `yaml:"Version"`
ProjectTitle string `yaml:"ProjectTitle"`
LogConfig *bool `yaml:"LogConfig"`
LogWorkerStart *bool `yaml:"LogWorkerStart"`
LogStateStorageDebug *bool `yaml:"LogStateStorageDebug"`
LogCommandStorageDebug *bool `yaml:"LogCommandStorageDebug"`
HttpServer *httpServerConfigRead `yaml:"HttpServer"`
Authentication *authenticationConfigRead `yaml:"Authentication"`
MqttClients map[string]mqttClientConfigRead `yaml:"MqttClients"`
Modbus map[string]modbusConfigRead `yaml:"Modbus"`
VictronDevices map[string]victronDeviceConfigRead `yaml:"VictronDevices"`
ModbusDevices map[string]modbusDeviceConfigRead `yaml:"ModbusDevices"`
HttpDevices map[string]httpDeviceConfigRead `yaml:"HttpDevices"`
MqttDevices map[string]mqttDeviceConfigRead `yaml:"MqttDevices"`
Views []viewConfigRead `yaml:"Views"`
}
type httpServerConfigRead struct {
Bind string `yaml:"Bind"`
Port *int `yaml:"Port"`
LogRequests *bool `yaml:"LogRequests"`
FrontendProxy string `yaml:"FrontendProxy"`
FrontendPath string `yaml:"FrontendPath"`
FrontendExpires string `yaml:"FrontendExpires"`
ConfigExpires string `yaml:"ConfigExpires"`
LogDebug *bool `yaml:"LogDebug"`
}
type authenticationConfigRead struct {
JwtSecret *string `yaml:"JwtSecret"`
JwtValidityPeriod string `yaml:"JwtValidityPeriod"`
HtaccessFile *string `yaml:"HtaccessFile"`
}
type mqttClientConfigRead struct {
Broker string `yaml:"Broker"`
ProtocolVersion *int `yaml:"ProtocolVersion"`
User string `yaml:"User"`
Password string `yaml:"Password"`
ClientId *string `yaml:"ClientId"`
KeepAlive string `yaml:"KeepAlive"`
ConnectRetryDelay string `yaml:"ConnectRetryDelay"`
ConnectTimeout string `yaml:"ConnectTimeout"`
TopicPrefix *string `yaml:"TopicPrefix"`
ReadOnly *bool `yaml:"ReadOnly"`
MaxBacklogSize *int `yaml:"MaxBacklogSize"`
MqttDevices map[string]mqttClientDeviceConfigRead `yaml:"MqttDevices"`
AvailabilityClient mqttSectionConfigRead `yaml:"AvailabilityClient"`
AvailabilityDevice mqttSectionConfigRead `yaml:"AvailabilityDevice"`
Structure mqttSectionConfigRead `yaml:"Structure"`
Telemetry mqttSectionConfigRead `yaml:"Telemetry"`
Realtime mqttSectionConfigRead `yaml:"Realtime"`
HomeassistantDiscovery mqttSectionConfigRead `yaml:"HomeassistantDiscovery"`
Command mqttSectionConfigRead `yaml:"Command"`
LogDebug *bool `yaml:"LogDebug"`
LogMessages *bool `yaml:"LogMessages"`
}
type mqttClientDeviceConfigRead struct {
MqttTopics []string `yaml:"MqttTopics"`
}
type mqttSectionConfigRead struct {
Enabled *bool `yaml:"Enabled"`
TopicTemplate *string `yaml:"TopicTemplate"`
Interval string `yaml:"Interval"`
Retain *bool `yaml:"Retain"`
Qos *byte `yaml:"Qos"`
Devices map[string]mqttDeviceSectionConfigRead `yaml:"Devices"`
}
type mqttDeviceSectionConfigRead struct {
Filter *filterConfigRead `yaml:"Filter"`
}
type modbusConfigRead struct {
Device string `yaml:"Device"`
BaudRate int `yaml:"BaudRate"`
ReadTimeout string `yaml:"ReadTimeout"`
LogDebug *bool `yaml:"LogDebug"`
}
type deviceConfigRead struct {
Filter filterConfigRead `yaml:"Filter"`
RestartInterval string `yaml:"RestartInterval"`
RestartIntervalMaxBackoff string `yaml:"RestartIntervalMaxBackoff"`
LogDebug *bool `yaml:"LogDebug"`
LogComDebug *bool `yaml:"LogComDebug"`
}
type victronDeviceConfigRead struct {
deviceConfigRead `yaml:",inline"`
Device string `yaml:"Device"`
Kind string `yaml:"Kind"`
PollInterval string `yaml:"PollInterval"`
IoLog *string `yaml:"IoLog"`
}
type modbusDeviceConfigRead struct {
deviceConfigRead `yaml:",inline"`
Bus string `yaml:"Bus"`
Kind string `yaml:"Kind"`
Address string `yaml:"Address"`
Relays map[string]relayConfigRead `yaml:"Relays"`
PollInterval string `yaml:"PollInterval"`
}
type relayConfigRead struct {
Description *string `yaml:"Description"`
OpenLabel *string `yaml:"OpenLabel"`
ClosedLabel *string `yaml:"ClosedLabel"`
}
type httpDeviceConfigRead struct {
deviceConfigRead `yaml:",inline"`
Url string `yaml:"Url"`
Kind string `yaml:"Kind"`
Username string `yaml:"Username"`
Password string `yaml:"Password"`
PollInterval string `yaml:"PollInterval"`
}
type mqttDeviceConfigRead struct {
deviceConfigRead `yaml:",inline"`
Kind string `yaml:"Kind"`
}
type viewConfigRead struct {
Name string `yaml:"Name"`
Title string `yaml:"Title"`
Devices []viewDeviceConfigRead `yaml:"Devices"`
Autoplay *bool `yaml:"Autoplay"`
AllowedUsers []string `yaml:"AllowedUsers"`
Hidden *bool `yaml:"Hidden"`
}
type viewDeviceConfigRead struct {
Name string `yaml:"Name"`
Title string `yaml:"Title"`
Filter filterConfigRead `yaml:"Filter"`
}
type filterConfigRead struct {
IncludeRegisters []string `yaml:"IncludeRegisters"`
SkipRegisters []string `yaml:"SkipRegisters"`
IncludeCategories []string `yaml:"IncludeCategories"`
SkipCategories []string `yaml:"SkipCategories"`
DefaultInclude *bool `yaml:"DefaultInclude"`
}