-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoor_comms.pb.go
339 lines (293 loc) · 11.5 KB
/
door_comms.pb.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: door_comms.proto
/*
Package door_comms is a generated protocol buffer package.
It is generated from these files:
door_comms.proto
It has these top-level messages:
ProtoMsg
DoorPing
DoorPingResp
GetAction
GetActionResp
ActionComplete
ActionCompleteResp
*/
package door_comms
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type MsgType int32
const (
MsgType_DOOR_PING MsgType = 0
MsgType_DOOR_PING_RESP MsgType = 1
MsgType_GET_ACTION MsgType = 2
MsgType_GET_ACTION_RESP MsgType = 3
MsgType_ACTION_COMPLETE MsgType = 4
MsgType_ACTION_COMPLETE_RESP MsgType = 5
)
var MsgType_name = map[int32]string{
0: "DOOR_PING",
1: "DOOR_PING_RESP",
2: "GET_ACTION",
3: "GET_ACTION_RESP",
4: "ACTION_COMPLETE",
5: "ACTION_COMPLETE_RESP",
}
var MsgType_value = map[string]int32{
"DOOR_PING": 0,
"DOOR_PING_RESP": 1,
"GET_ACTION": 2,
"GET_ACTION_RESP": 3,
"ACTION_COMPLETE": 4,
"ACTION_COMPLETE_RESP": 5,
}
func (x MsgType) Enum() *MsgType {
p := new(MsgType)
*p = x
return p
}
func (x MsgType) String() string {
return proto.EnumName(MsgType_name, int32(x))
}
func (x *MsgType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(MsgType_value, data, "MsgType")
if err != nil {
return err
}
*x = MsgType(value)
return nil
}
func (MsgType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type DoorAction int32
const (
DoorAction_DOOR_UNLOCK DoorAction = 0
)
var DoorAction_name = map[int32]string{
0: "DOOR_UNLOCK",
}
var DoorAction_value = map[string]int32{
"DOOR_UNLOCK": 0,
}
func (x DoorAction) Enum() *DoorAction {
p := new(DoorAction)
*p = x
return p
}
func (x DoorAction) String() string {
return proto.EnumName(DoorAction_name, int32(x))
}
func (x *DoorAction) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(DoorAction_value, data, "DoorAction")
if err != nil {
return err
}
*x = DoorAction(value)
return nil
}
func (DoorAction) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type ProtoMsg struct {
Type *MsgType `protobuf:"varint,1,req,name=type,enum=door_comms.MsgType" json:"type,omitempty"`
Msg []byte `protobuf:"bytes,2,req,name=msg" json:"msg,omitempty"`
Mac *string `protobuf:"bytes,3,req,name=mac" json:"mac,omitempty"`
Sig []byte `protobuf:"bytes,4,req,name=sig" json:"sig,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ProtoMsg) Reset() { *m = ProtoMsg{} }
func (m *ProtoMsg) String() string { return proto.CompactTextString(m) }
func (*ProtoMsg) ProtoMessage() {}
func (*ProtoMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *ProtoMsg) GetType() MsgType {
if m != nil && m.Type != nil {
return *m.Type
}
return MsgType_DOOR_PING
}
func (m *ProtoMsg) GetMsg() []byte {
if m != nil {
return m.Msg
}
return nil
}
func (m *ProtoMsg) GetMac() string {
if m != nil && m.Mac != nil {
return *m.Mac
}
return ""
}
func (m *ProtoMsg) GetSig() []byte {
if m != nil {
return m.Sig
}
return nil
}
type DoorPing struct {
Timestamp *int64 `protobuf:"varint,1,req,name=timestamp" json:"timestamp,omitempty"`
PublicKey []byte `protobuf:"bytes,2,req,name=publicKey" json:"publicKey,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DoorPing) Reset() { *m = DoorPing{} }
func (m *DoorPing) String() string { return proto.CompactTextString(m) }
func (*DoorPing) ProtoMessage() {}
func (*DoorPing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *DoorPing) GetTimestamp() int64 {
if m != nil && m.Timestamp != nil {
return *m.Timestamp
}
return 0
}
func (m *DoorPing) GetPublicKey() []byte {
if m != nil {
return m.PublicKey
}
return nil
}
type DoorPingResp struct {
Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
DoorName *string `protobuf:"bytes,2,opt,name=doorName" json:"doorName,omitempty"`
Error *string `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"`
ActionRequired *bool `protobuf:"varint,4,opt,name=actionRequired" json:"actionRequired,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DoorPingResp) Reset() { *m = DoorPingResp{} }
func (m *DoorPingResp) String() string { return proto.CompactTextString(m) }
func (*DoorPingResp) ProtoMessage() {}
func (*DoorPingResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *DoorPingResp) GetSuccess() bool {
if m != nil && m.Success != nil {
return *m.Success
}
return false
}
func (m *DoorPingResp) GetDoorName() string {
if m != nil && m.DoorName != nil {
return *m.DoorName
}
return ""
}
func (m *DoorPingResp) GetError() string {
if m != nil && m.Error != nil {
return *m.Error
}
return ""
}
func (m *DoorPingResp) GetActionRequired() bool {
if m != nil && m.ActionRequired != nil {
return *m.ActionRequired
}
return false
}
type GetAction struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *GetAction) Reset() { *m = GetAction{} }
func (m *GetAction) String() string { return proto.CompactTextString(m) }
func (*GetAction) ProtoMessage() {}
func (*GetAction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
type GetActionResp struct {
ActionId *int64 `protobuf:"varint,1,opt,name=actionId" json:"actionId,omitempty"`
ActionType *DoorAction `protobuf:"varint,2,opt,name=actionType,enum=door_comms.DoorAction" json:"actionType,omitempty"`
ActionPayload []byte `protobuf:"bytes,3,opt,name=actionPayload" json:"actionPayload,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *GetActionResp) Reset() { *m = GetActionResp{} }
func (m *GetActionResp) String() string { return proto.CompactTextString(m) }
func (*GetActionResp) ProtoMessage() {}
func (*GetActionResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *GetActionResp) GetActionId() int64 {
if m != nil && m.ActionId != nil {
return *m.ActionId
}
return 0
}
func (m *GetActionResp) GetActionType() DoorAction {
if m != nil && m.ActionType != nil {
return *m.ActionType
}
return DoorAction_DOOR_UNLOCK
}
func (m *GetActionResp) GetActionPayload() []byte {
if m != nil {
return m.ActionPayload
}
return nil
}
type ActionComplete struct {
ActionId *int64 `protobuf:"varint,1,req,name=actionId" json:"actionId,omitempty"`
Success *bool `protobuf:"varint,2,req,name=success" json:"success,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ActionComplete) Reset() { *m = ActionComplete{} }
func (m *ActionComplete) String() string { return proto.CompactTextString(m) }
func (*ActionComplete) ProtoMessage() {}
func (*ActionComplete) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *ActionComplete) GetActionId() int64 {
if m != nil && m.ActionId != nil {
return *m.ActionId
}
return 0
}
func (m *ActionComplete) GetSuccess() bool {
if m != nil && m.Success != nil {
return *m.Success
}
return false
}
type ActionCompleteResp struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *ActionCompleteResp) Reset() { *m = ActionCompleteResp{} }
func (m *ActionCompleteResp) String() string { return proto.CompactTextString(m) }
func (*ActionCompleteResp) ProtoMessage() {}
func (*ActionCompleteResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func init() {
proto.RegisterType((*ProtoMsg)(nil), "door_comms.ProtoMsg")
proto.RegisterType((*DoorPing)(nil), "door_comms.DoorPing")
proto.RegisterType((*DoorPingResp)(nil), "door_comms.DoorPingResp")
proto.RegisterType((*GetAction)(nil), "door_comms.GetAction")
proto.RegisterType((*GetActionResp)(nil), "door_comms.GetActionResp")
proto.RegisterType((*ActionComplete)(nil), "door_comms.ActionComplete")
proto.RegisterType((*ActionCompleteResp)(nil), "door_comms.ActionCompleteResp")
proto.RegisterEnum("door_comms.MsgType", MsgType_name, MsgType_value)
proto.RegisterEnum("door_comms.DoorAction", DoorAction_name, DoorAction_value)
}
func init() { proto.RegisterFile("door_comms.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 430 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcf, 0x6b, 0xdb, 0x30,
0x14, 0xc7, 0x2b, 0x3b, 0xa5, 0xf6, 0x6b, 0xe2, 0x9a,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