-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.pb.go
337 lines (283 loc) · 10.9 KB
/
api.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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: api.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
PainUpdate
GetEventsRequest
Event
*/
package proto
import proto1 "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.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 _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
type PainLevel int32
const (
PainLevel_NO_PAIN PainLevel = 0
PainLevel_SIGNIFICANT PainLevel = 1
PainLevel_SEVERE PainLevel = 2
)
var PainLevel_name = map[int32]string{
0: "NO_PAIN",
1: "SIGNIFICANT",
2: "SEVERE",
}
var PainLevel_value = map[string]int32{
"NO_PAIN": 0,
"SIGNIFICANT": 1,
"SEVERE": 2,
}
func (x PainLevel) String() string {
return proto1.EnumName(PainLevel_name, int32(x))
}
func (PainLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type PainUpdate struct {
PainLevel PainLevel `protobuf:"varint,1,opt,name=pain_level,json=painLevel,enum=PainLevel" json:"pain_level,omitempty"`
Passphrase string `protobuf:"bytes,2,opt,name=passphrase" json:"passphrase,omitempty"`
}
func (m *PainUpdate) Reset() { *m = PainUpdate{} }
func (m *PainUpdate) String() string { return proto1.CompactTextString(m) }
func (*PainUpdate) ProtoMessage() {}
func (*PainUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *PainUpdate) GetPainLevel() PainLevel {
if m != nil {
return m.PainLevel
}
return PainLevel_NO_PAIN
}
func (m *PainUpdate) GetPassphrase() string {
if m != nil {
return m.Passphrase
}
return ""
}
type GetEventsRequest struct {
Start *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=start" json:"start,omitempty"`
End *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=end" json:"end,omitempty"`
}
func (m *GetEventsRequest) Reset() { *m = GetEventsRequest{} }
func (m *GetEventsRequest) String() string { return proto1.CompactTextString(m) }
func (*GetEventsRequest) ProtoMessage() {}
func (*GetEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *GetEventsRequest) GetStart() *google_protobuf1.Timestamp {
if m != nil {
return m.Start
}
return nil
}
func (m *GetEventsRequest) GetEnd() *google_protobuf1.Timestamp {
if m != nil {
return m.End
}
return nil
}
type Event struct {
Timestamp *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"`
PainLevel PainLevel `protobuf:"varint,2,opt,name=pain_level,json=painLevel,enum=PainLevel" json:"pain_level,omitempty"`
}
func (m *Event) Reset() { *m = Event{} }
func (m *Event) String() string { return proto1.CompactTextString(m) }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Event) GetTimestamp() *google_protobuf1.Timestamp {
if m != nil {
return m.Timestamp
}
return nil
}
func (m *Event) GetPainLevel() PainLevel {
if m != nil {
return m.PainLevel
}
return PainLevel_NO_PAIN
}
func init() {
proto1.RegisterType((*PainUpdate)(nil), "PainUpdate")
proto1.RegisterType((*GetEventsRequest)(nil), "GetEventsRequest")
proto1.RegisterType((*Event)(nil), "Event")
proto1.RegisterEnum("PainLevel", PainLevel_name, PainLevel_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for PainTracker service
type PainTrackerClient interface {
SetPainLevel(ctx context.Context, in *PainUpdate, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}
type painTrackerClient struct {
cc *grpc.ClientConn
}
func NewPainTrackerClient(cc *grpc.ClientConn) PainTrackerClient {
return &painTrackerClient{cc}
}
func (c *painTrackerClient) SetPainLevel(ctx context.Context, in *PainUpdate, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/PainTracker/SetPainLevel", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for PainTracker service
type PainTrackerServer interface {
SetPainLevel(context.Context, *PainUpdate) (*google_protobuf.Empty, error)
}
func RegisterPainTrackerServer(s *grpc.Server, srv PainTrackerServer) {
s.RegisterService(&_PainTracker_serviceDesc, srv)
}
func _PainTracker_SetPainLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PainUpdate)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PainTrackerServer).SetPainLevel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PainTracker/SetPainLevel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PainTrackerServer).SetPainLevel(ctx, req.(*PainUpdate))
}
return interceptor(ctx, in, info, handler)
}
var _PainTracker_serviceDesc = grpc.ServiceDesc{
ServiceName: "PainTracker",
HandlerType: (*PainTrackerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SetPainLevel",
Handler: _PainTracker_SetPainLevel_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}
// Client API for Monitor service
type MonitorClient interface {
GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (Monitor_GetEventsClient, error)
}
type monitorClient struct {
cc *grpc.ClientConn
}
func NewMonitorClient(cc *grpc.ClientConn) MonitorClient {
return &monitorClient{cc}
}
func (c *monitorClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (Monitor_GetEventsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Monitor_serviceDesc.Streams[0], c.cc, "/Monitor/GetEvents", opts...)
if err != nil {
return nil, err
}
x := &monitorGetEventsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Monitor_GetEventsClient interface {
Recv() (*Event, error)
grpc.ClientStream
}
type monitorGetEventsClient struct {
grpc.ClientStream
}
func (x *monitorGetEventsClient) Recv() (*Event, error) {
m := new(Event)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for Monitor service
type MonitorServer interface {
GetEvents(*GetEventsRequest, Monitor_GetEventsServer) error
}
func RegisterMonitorServer(s *grpc.Server, srv MonitorServer) {
s.RegisterService(&_Monitor_serviceDesc, srv)
}
func _Monitor_GetEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(GetEventsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(MonitorServer).GetEvents(m, &monitorGetEventsServer{stream})
}
type Monitor_GetEventsServer interface {
Send(*Event) error
grpc.ServerStream
}
type monitorGetEventsServer struct {
grpc.ServerStream
}
func (x *monitorGetEventsServer) Send(m *Event) error {
return x.ServerStream.SendMsg(m)
}
var _Monitor_serviceDesc = grpc.ServiceDesc{
ServiceName: "Monitor",
HandlerType: (*MonitorServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "GetEvents",
Handler: _Monitor_GetEvents_Handler,
ServerStreams: true,
},
},
Metadata: "api.proto",
}
func init() { proto1.RegisterFile("api.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 424 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0x6e, 0xd3, 0x30,
0x14, 0x86, 0x49, 0xd1, 0x3a, 0xe5, 0x74, 0x1a, 0x9d, 0x91, 0x60, 0x14, 0x04, 0x53, 0xae, 0x46,
0xc5, 0x9c, 0x51, 0x34, 0x81, 0x76, 0x37, 0xa6, 0x30, 0x55, 0x1a, 0x61, 0x4a, 0x0b, 0x48, 0x70,
0x31, 0xb9, 0xad, 0x69, 0x0c, 0x89, 0x6d, 0xec, 0xd3, 0x4a, 0xdc, 0xf2, 0x0a, 0x3c, 0x1a, 0xaf,
0xc0, 0x83, 0x20, 0x3b, 0x49, 0x37, 0x15, 0x69, 0xe2, 0x2a, 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