/
dcs_grpc.pb.go
438 lines (390 loc) · 15.3 KB
/
dcs_grpc.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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
//
// === This file is part of ALICE O² ===
//
// Copyright 2020-2021 CERN and copyright holders of ALICE O².
// Authors: Teo Mrnjavac <teo.mrnjavac@cern.ch>
// Ombretta Pinazza <ombretta.pinazza@cern.ch>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// In applying this license CERN does not waive the privileges and
// immunities granted to it by virtue of its status as an
// Intergovernmental Organization or submit itself to any jurisdiction.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.1
// source: protos/dcs.proto
package dcspb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Configurator_Subscribe_FullMethodName = "/dcs.Configurator/Subscribe"
Configurator_PrepareForRun_FullMethodName = "/dcs.Configurator/PrepareForRun"
Configurator_StartOfRun_FullMethodName = "/dcs.Configurator/StartOfRun"
Configurator_EndOfRun_FullMethodName = "/dcs.Configurator/EndOfRun"
Configurator_GetStatus_FullMethodName = "/dcs.Configurator/GetStatus"
)
// ConfiguratorClient is the client API for Configurator service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ConfiguratorClient interface {
// Optional call, legal at any time, to subscribe to all future events from
// the DCS service. The server stops serving the stream when the client closes
// it. Multiple concurrent stream subscriptions are allowed.
Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (Configurator_SubscribeClient, error)
// Single PFR request for a data taking session, with per-detector parameters.
// Returns an event stream which returns subsequent intermediate states within
// the PFR operation. Upon PFR completion (DetectorState.RUN_OK), the server
// closes the stream.
PrepareForRun(ctx context.Context, in *PfrRequest, opts ...grpc.CallOption) (Configurator_PrepareForRunClient, error)
// Single SOR request for a data taking session, with run number.
// Returns an event stream which returns subsequent intermediate states within
// the SOR operation. Upon SOR completion (DetectorState.RUN_OK), the server
// closes the stream.
// If the DetectorOperationRequest or run type parameters are the same as the
// last PrepareForRun request (no matter how far back in time) and the DCS
// state hasn't changed, the SOR operations should be fast. Otherwise, the SOR
// also implicitly includes any number of PrepareForRun operations as needed,
// this can take a while but should not change the overall behavior reported
// to ECS.
StartOfRun(ctx context.Context, in *SorRequest, opts ...grpc.CallOption) (Configurator_StartOfRunClient, error)
// Single EOR request for a data taking session, with per-detector parameters.
// Returns an event stream which returns subsequent intermediate states within
// the EOR operation. Upon EOR completion (DetectorState.RUN_OK), the server
// closes the stream.
EndOfRun(ctx context.Context, in *EorRequest, opts ...grpc.CallOption) (Configurator_EndOfRunClient, error)
// Optional call, legal at any time, to query the status of the DCS service
// and either some or all of its constituent detectors. This call returns a
// single value (not a stream), reflecting the service state at that
// specific moment.
GetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error)
}
type configuratorClient struct {
cc grpc.ClientConnInterface
}
func NewConfiguratorClient(cc grpc.ClientConnInterface) ConfiguratorClient {
return &configuratorClient{cc}
}
func (c *configuratorClient) Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (Configurator_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &Configurator_ServiceDesc.Streams[0], Configurator_Subscribe_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &configuratorSubscribeClient{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 Configurator_SubscribeClient interface {
Recv() (*Event, error)
grpc.ClientStream
}
type configuratorSubscribeClient struct {
grpc.ClientStream
}
func (x *configuratorSubscribeClient) Recv() (*Event, error) {
m := new(Event)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *configuratorClient) PrepareForRun(ctx context.Context, in *PfrRequest, opts ...grpc.CallOption) (Configurator_PrepareForRunClient, error) {
stream, err := c.cc.NewStream(ctx, &Configurator_ServiceDesc.Streams[1], Configurator_PrepareForRun_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &configuratorPrepareForRunClient{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 Configurator_PrepareForRunClient interface {
Recv() (*RunEvent, error)
grpc.ClientStream
}
type configuratorPrepareForRunClient struct {
grpc.ClientStream
}
func (x *configuratorPrepareForRunClient) Recv() (*RunEvent, error) {
m := new(RunEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *configuratorClient) StartOfRun(ctx context.Context, in *SorRequest, opts ...grpc.CallOption) (Configurator_StartOfRunClient, error) {
stream, err := c.cc.NewStream(ctx, &Configurator_ServiceDesc.Streams[2], Configurator_StartOfRun_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &configuratorStartOfRunClient{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 Configurator_StartOfRunClient interface {
Recv() (*RunEvent, error)
grpc.ClientStream
}
type configuratorStartOfRunClient struct {
grpc.ClientStream
}
func (x *configuratorStartOfRunClient) Recv() (*RunEvent, error) {
m := new(RunEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *configuratorClient) EndOfRun(ctx context.Context, in *EorRequest, opts ...grpc.CallOption) (Configurator_EndOfRunClient, error) {
stream, err := c.cc.NewStream(ctx, &Configurator_ServiceDesc.Streams[3], Configurator_EndOfRun_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &configuratorEndOfRunClient{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 Configurator_EndOfRunClient interface {
Recv() (*RunEvent, error)
grpc.ClientStream
}
type configuratorEndOfRunClient struct {
grpc.ClientStream
}
func (x *configuratorEndOfRunClient) Recv() (*RunEvent, error) {
m := new(RunEvent)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *configuratorClient) GetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) {
out := new(StatusReply)
err := c.cc.Invoke(ctx, Configurator_GetStatus_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConfiguratorServer is the server API for Configurator service.
// All implementations should embed UnimplementedConfiguratorServer
// for forward compatibility
type ConfiguratorServer interface {
// Optional call, legal at any time, to subscribe to all future events from
// the DCS service. The server stops serving the stream when the client closes
// it. Multiple concurrent stream subscriptions are allowed.
Subscribe(*SubscriptionRequest, Configurator_SubscribeServer) error
// Single PFR request for a data taking session, with per-detector parameters.
// Returns an event stream which returns subsequent intermediate states within
// the PFR operation. Upon PFR completion (DetectorState.RUN_OK), the server
// closes the stream.
PrepareForRun(*PfrRequest, Configurator_PrepareForRunServer) error
// Single SOR request for a data taking session, with run number.
// Returns an event stream which returns subsequent intermediate states within
// the SOR operation. Upon SOR completion (DetectorState.RUN_OK), the server
// closes the stream.
// If the DetectorOperationRequest or run type parameters are the same as the
// last PrepareForRun request (no matter how far back in time) and the DCS
// state hasn't changed, the SOR operations should be fast. Otherwise, the SOR
// also implicitly includes any number of PrepareForRun operations as needed,
// this can take a while but should not change the overall behavior reported
// to ECS.
StartOfRun(*SorRequest, Configurator_StartOfRunServer) error
// Single EOR request for a data taking session, with per-detector parameters.
// Returns an event stream which returns subsequent intermediate states within
// the EOR operation. Upon EOR completion (DetectorState.RUN_OK), the server
// closes the stream.
EndOfRun(*EorRequest, Configurator_EndOfRunServer) error
// Optional call, legal at any time, to query the status of the DCS service
// and either some or all of its constituent detectors. This call returns a
// single value (not a stream), reflecting the service state at that
// specific moment.
GetStatus(context.Context, *StatusRequest) (*StatusReply, error)
}
// UnimplementedConfiguratorServer should be embedded to have forward compatible implementations.
type UnimplementedConfiguratorServer struct {
}
func (UnimplementedConfiguratorServer) Subscribe(*SubscriptionRequest, Configurator_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedConfiguratorServer) PrepareForRun(*PfrRequest, Configurator_PrepareForRunServer) error {
return status.Errorf(codes.Unimplemented, "method PrepareForRun not implemented")
}
func (UnimplementedConfiguratorServer) StartOfRun(*SorRequest, Configurator_StartOfRunServer) error {
return status.Errorf(codes.Unimplemented, "method StartOfRun not implemented")
}
func (UnimplementedConfiguratorServer) EndOfRun(*EorRequest, Configurator_EndOfRunServer) error {
return status.Errorf(codes.Unimplemented, "method EndOfRun not implemented")
}
func (UnimplementedConfiguratorServer) GetStatus(context.Context, *StatusRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetStatus not implemented")
}
// UnsafeConfiguratorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConfiguratorServer will
// result in compilation errors.
type UnsafeConfiguratorServer interface {
mustEmbedUnimplementedConfiguratorServer()
}
func RegisterConfiguratorServer(s grpc.ServiceRegistrar, srv ConfiguratorServer) {
s.RegisterService(&Configurator_ServiceDesc, srv)
}
func _Configurator_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SubscriptionRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConfiguratorServer).Subscribe(m, &configuratorSubscribeServer{stream})
}
type Configurator_SubscribeServer interface {
Send(*Event) error
grpc.ServerStream
}
type configuratorSubscribeServer struct {
grpc.ServerStream
}
func (x *configuratorSubscribeServer) Send(m *Event) error {
return x.ServerStream.SendMsg(m)
}
func _Configurator_PrepareForRun_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(PfrRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConfiguratorServer).PrepareForRun(m, &configuratorPrepareForRunServer{stream})
}
type Configurator_PrepareForRunServer interface {
Send(*RunEvent) error
grpc.ServerStream
}
type configuratorPrepareForRunServer struct {
grpc.ServerStream
}
func (x *configuratorPrepareForRunServer) Send(m *RunEvent) error {
return x.ServerStream.SendMsg(m)
}
func _Configurator_StartOfRun_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SorRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConfiguratorServer).StartOfRun(m, &configuratorStartOfRunServer{stream})
}
type Configurator_StartOfRunServer interface {
Send(*RunEvent) error
grpc.ServerStream
}
type configuratorStartOfRunServer struct {
grpc.ServerStream
}
func (x *configuratorStartOfRunServer) Send(m *RunEvent) error {
return x.ServerStream.SendMsg(m)
}
func _Configurator_EndOfRun_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(EorRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConfiguratorServer).EndOfRun(m, &configuratorEndOfRunServer{stream})
}
type Configurator_EndOfRunServer interface {
Send(*RunEvent) error
grpc.ServerStream
}
type configuratorEndOfRunServer struct {
grpc.ServerStream
}
func (x *configuratorEndOfRunServer) Send(m *RunEvent) error {
return x.ServerStream.SendMsg(m)
}
func _Configurator_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfiguratorServer).GetStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Configurator_GetStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfiguratorServer).GetStatus(ctx, req.(*StatusRequest))
}
return interceptor(ctx, in, info, handler)
}
// Configurator_ServiceDesc is the grpc.ServiceDesc for Configurator service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Configurator_ServiceDesc = grpc.ServiceDesc{
ServiceName: "dcs.Configurator",
HandlerType: (*ConfiguratorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetStatus",
Handler: _Configurator_GetStatus_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _Configurator_Subscribe_Handler,
ServerStreams: true,
},
{
StreamName: "PrepareForRun",
Handler: _Configurator_PrepareForRun_Handler,
ServerStreams: true,
},
{
StreamName: "StartOfRun",
Handler: _Configurator_StartOfRun_Handler,
ServerStreams: true,
},
{
StreamName: "EndOfRun",
Handler: _Configurator_EndOfRun_Handler,
ServerStreams: true,
},
},
Metadata: "protos/dcs.proto",
}