Repository navigation
Expand file tree
/
Copy patharke_grpc.pb.go
More file actions
616 lines (556 loc) · 23.6 KB
/
Copy patharke_grpc.pb.go
File metadata and controls
616 lines (556 loc) · 23.6 KB
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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
//*
// Arke message broker proxy messages.
//
// This file outlines the gRPC interface for the Arke proxy.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.36.0
// source: arke.proto
package api
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Producer_Connect_FullMethodName = "/arke.Producer/Connect"
Producer_Publish_FullMethodName = "/arke.Producer/Publish"
Producer_PublishOne_FullMethodName = "/arke.Producer/PublishOne"
Producer_Disconnect_FullMethodName = "/arke.Producer/Disconnect"
)
// ProducerClient is the client API for Producer 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.
//
// Service for producing messages
type ProducerClient interface {
// Connect to a message broker. Pass in a ConnectionConfiguration with broker
// specific connection information.
Connect(ctx context.Context, in *ConnectionConfiguration, opts ...grpc.CallOption) (*ConnectResponse, error)
// Send a stream of messages to the message broker.
Publish(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, MessageResponse], error)
// Send one message to the message broker.
PublishOne(ctx context.Context, in *Message, opts ...grpc.CallOption) (*MessageResponse, error)
// Disconnect from the proxy and the message broker.
Disconnect(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}
type producerClient struct {
cc grpc.ClientConnInterface
}
func NewProducerClient(cc grpc.ClientConnInterface) ProducerClient {
return &producerClient{cc}
}
func (c *producerClient) Connect(ctx context.Context, in *ConnectionConfiguration, opts ...grpc.CallOption) (*ConnectResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ConnectResponse)
err := c.cc.Invoke(ctx, Producer_Connect_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *producerClient) Publish(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, MessageResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Producer_ServiceDesc.Streams[0], Producer_Publish_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[Message, MessageResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Producer_PublishClient = grpc.BidiStreamingClient[Message, MessageResponse]
func (c *producerClient) PublishOne(ctx context.Context, in *Message, opts ...grpc.CallOption) (*MessageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MessageResponse)
err := c.cc.Invoke(ctx, Producer_PublishOne_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *producerClient) Disconnect(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Empty)
err := c.cc.Invoke(ctx, Producer_Disconnect_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ProducerServer is the server API for Producer service.
// All implementations must embed UnimplementedProducerServer
// for forward compatibility.
//
// Service for producing messages
type ProducerServer interface {
// Connect to a message broker. Pass in a ConnectionConfiguration with broker
// specific connection information.
Connect(context.Context, *ConnectionConfiguration) (*ConnectResponse, error)
// Send a stream of messages to the message broker.
Publish(grpc.BidiStreamingServer[Message, MessageResponse]) error
// Send one message to the message broker.
PublishOne(context.Context, *Message) (*MessageResponse, error)
// Disconnect from the proxy and the message broker.
Disconnect(context.Context, *Empty) (*Empty, error)
mustEmbedUnimplementedProducerServer()
}
// UnimplementedProducerServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedProducerServer struct{}
func (UnimplementedProducerServer) Connect(context.Context, *ConnectionConfiguration) (*ConnectResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Connect not implemented")
}
func (UnimplementedProducerServer) Publish(grpc.BidiStreamingServer[Message, MessageResponse]) error {
return status.Error(codes.Unimplemented, "method Publish not implemented")
}
func (UnimplementedProducerServer) PublishOne(context.Context, *Message) (*MessageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method PublishOne not implemented")
}
func (UnimplementedProducerServer) Disconnect(context.Context, *Empty) (*Empty, error) {
return nil, status.Error(codes.Unimplemented, "method Disconnect not implemented")
}
func (UnimplementedProducerServer) mustEmbedUnimplementedProducerServer() {}
func (UnimplementedProducerServer) testEmbeddedByValue() {}
// UnsafeProducerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ProducerServer will
// result in compilation errors.
type UnsafeProducerServer interface {
mustEmbedUnimplementedProducerServer()
}
func RegisterProducerServer(s grpc.ServiceRegistrar, srv ProducerServer) {
// If the following call panics, it indicates UnimplementedProducerServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Producer_ServiceDesc, srv)
}
func _Producer_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ConnectionConfiguration)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProducerServer).Connect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Producer_Connect_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProducerServer).Connect(ctx, req.(*ConnectionConfiguration))
}
return interceptor(ctx, in, info, handler)
}
func _Producer_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ProducerServer).Publish(&grpc.GenericServerStream[Message, MessageResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Producer_PublishServer = grpc.BidiStreamingServer[Message, MessageResponse]
func _Producer_PublishOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Message)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProducerServer).PublishOne(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Producer_PublishOne_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProducerServer).PublishOne(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _Producer_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProducerServer).Disconnect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Producer_Disconnect_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProducerServer).Disconnect(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
// Producer_ServiceDesc is the grpc.ServiceDesc for Producer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Producer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "arke.Producer",
HandlerType: (*ProducerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Connect",
Handler: _Producer_Connect_Handler,
},
{
MethodName: "PublishOne",
Handler: _Producer_PublishOne_Handler,
},
{
MethodName: "Disconnect",
Handler: _Producer_Disconnect_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Publish",
Handler: _Producer_Publish_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "arke.proto",
}
const (
Consumer_Connect_FullMethodName = "/arke.Consumer/Connect"
Consumer_Consume_FullMethodName = "/arke.Consumer/Consume"
Consumer_Disconnect_FullMethodName = "/arke.Consumer/Disconnect"
Consumer_SourceStats_FullMethodName = "/arke.Consumer/SourceStats"
Consumer_SourceStatsGroup_FullMethodName = "/arke.Consumer/SourceStatsGroup"
)
// ConsumerClient is the client API for Consumer 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.
//
// Service for consuming messages
type ConsumerClient interface {
// Connect to a message broker. Pass in a ConnectionConfiguration with broker
// specific connection information.
Connect(ctx context.Context, in *ConnectionConfiguration, opts ...grpc.CallOption) (*ConnectResponse, error)
// Subscribe to a message broker source and receive a stream of messages when they are available.
Consume(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Consume, ConsumeResponse], error)
// Disconnect from the proxy and the message broker.
Disconnect(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
// Ask for and receive information about an arke.Source
SourceStats(ctx context.Context, in *Source, opts ...grpc.CallOption) (*SourceStats, error)
// Ask for and receive information about a group of arke.Sources
SourceStatsGroup(ctx context.Context, in *Sources, opts ...grpc.CallOption) (*SourceStatsCollection, error)
}
type consumerClient struct {
cc grpc.ClientConnInterface
}
func NewConsumerClient(cc grpc.ClientConnInterface) ConsumerClient {
return &consumerClient{cc}
}
func (c *consumerClient) Connect(ctx context.Context, in *ConnectionConfiguration, opts ...grpc.CallOption) (*ConnectResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ConnectResponse)
err := c.cc.Invoke(ctx, Consumer_Connect_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *consumerClient) Consume(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Consume, ConsumeResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Consumer_ServiceDesc.Streams[0], Consumer_Consume_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[Consume, ConsumeResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consumer_ConsumeClient = grpc.BidiStreamingClient[Consume, ConsumeResponse]
func (c *consumerClient) Disconnect(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Empty)
err := c.cc.Invoke(ctx, Consumer_Disconnect_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *consumerClient) SourceStats(ctx context.Context, in *Source, opts ...grpc.CallOption) (*SourceStats, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SourceStats)
err := c.cc.Invoke(ctx, Consumer_SourceStats_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *consumerClient) SourceStatsGroup(ctx context.Context, in *Sources, opts ...grpc.CallOption) (*SourceStatsCollection, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SourceStatsCollection)
err := c.cc.Invoke(ctx, Consumer_SourceStatsGroup_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConsumerServer is the server API for Consumer service.
// All implementations must embed UnimplementedConsumerServer
// for forward compatibility.
//
// Service for consuming messages
type ConsumerServer interface {
// Connect to a message broker. Pass in a ConnectionConfiguration with broker
// specific connection information.
Connect(context.Context, *ConnectionConfiguration) (*ConnectResponse, error)
// Subscribe to a message broker source and receive a stream of messages when they are available.
Consume(grpc.BidiStreamingServer[Consume, ConsumeResponse]) error
// Disconnect from the proxy and the message broker.
Disconnect(context.Context, *Empty) (*Empty, error)
// Ask for and receive information about an arke.Source
SourceStats(context.Context, *Source) (*SourceStats, error)
// Ask for and receive information about a group of arke.Sources
SourceStatsGroup(context.Context, *Sources) (*SourceStatsCollection, error)
mustEmbedUnimplementedConsumerServer()
}
// UnimplementedConsumerServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedConsumerServer struct{}
func (UnimplementedConsumerServer) Connect(context.Context, *ConnectionConfiguration) (*ConnectResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Connect not implemented")
}
func (UnimplementedConsumerServer) Consume(grpc.BidiStreamingServer[Consume, ConsumeResponse]) error {
return status.Error(codes.Unimplemented, "method Consume not implemented")
}
func (UnimplementedConsumerServer) Disconnect(context.Context, *Empty) (*Empty, error) {
return nil, status.Error(codes.Unimplemented, "method Disconnect not implemented")
}
func (UnimplementedConsumerServer) SourceStats(context.Context, *Source) (*SourceStats, error) {
return nil, status.Error(codes.Unimplemented, "method SourceStats not implemented")
}
func (UnimplementedConsumerServer) SourceStatsGroup(context.Context, *Sources) (*SourceStatsCollection, error) {
return nil, status.Error(codes.Unimplemented, "method SourceStatsGroup not implemented")
}
func (UnimplementedConsumerServer) mustEmbedUnimplementedConsumerServer() {}
func (UnimplementedConsumerServer) testEmbeddedByValue() {}
// UnsafeConsumerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConsumerServer will
// result in compilation errors.
type UnsafeConsumerServer interface {
mustEmbedUnimplementedConsumerServer()
}
func RegisterConsumerServer(s grpc.ServiceRegistrar, srv ConsumerServer) {
// If the following call panics, it indicates UnimplementedConsumerServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Consumer_ServiceDesc, srv)
}
func _Consumer_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ConnectionConfiguration)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConsumerServer).Connect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Consumer_Connect_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConsumerServer).Connect(ctx, req.(*ConnectionConfiguration))
}
return interceptor(ctx, in, info, handler)
}
func _Consumer_Consume_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ConsumerServer).Consume(&grpc.GenericServerStream[Consume, ConsumeResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consumer_ConsumeServer = grpc.BidiStreamingServer[Consume, ConsumeResponse]
func _Consumer_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConsumerServer).Disconnect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Consumer_Disconnect_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConsumerServer).Disconnect(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Consumer_SourceStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Source)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConsumerServer).SourceStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Consumer_SourceStats_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConsumerServer).SourceStats(ctx, req.(*Source))
}
return interceptor(ctx, in, info, handler)
}
func _Consumer_SourceStatsGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Sources)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConsumerServer).SourceStatsGroup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Consumer_SourceStatsGroup_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConsumerServer).SourceStatsGroup(ctx, req.(*Sources))
}
return interceptor(ctx, in, info, handler)
}
// Consumer_ServiceDesc is the grpc.ServiceDesc for Consumer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Consumer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "arke.Consumer",
HandlerType: (*ConsumerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Connect",
Handler: _Consumer_Connect_Handler,
},
{
MethodName: "Disconnect",
Handler: _Consumer_Disconnect_Handler,
},
{
MethodName: "SourceStats",
Handler: _Consumer_SourceStats_Handler,
},
{
MethodName: "SourceStatsGroup",
Handler: _Consumer_SourceStatsGroup_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Consume",
Handler: _Consumer_Consume_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "arke.proto",
}
const (
Healthz_Check_FullMethodName = "/arke.Healthz/Check"
)
// HealthzClient is the client API for Healthz 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.
//
// *
// Service for health checks and communication
type HealthzClient interface {
Check(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Health, Health], error)
}
type healthzClient struct {
cc grpc.ClientConnInterface
}
func NewHealthzClient(cc grpc.ClientConnInterface) HealthzClient {
return &healthzClient{cc}
}
func (c *healthzClient) Check(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Health, Health], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Healthz_ServiceDesc.Streams[0], Healthz_Check_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[Health, Health]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Healthz_CheckClient = grpc.BidiStreamingClient[Health, Health]
// HealthzServer is the server API for Healthz service.
// All implementations must embed UnimplementedHealthzServer
// for forward compatibility.
//
// *
// Service for health checks and communication
type HealthzServer interface {
Check(grpc.BidiStreamingServer[Health, Health]) error
mustEmbedUnimplementedHealthzServer()
}
// UnimplementedHealthzServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedHealthzServer struct{}
func (UnimplementedHealthzServer) Check(grpc.BidiStreamingServer[Health, Health]) error {
return status.Error(codes.Unimplemented, "method Check not implemented")
}
func (UnimplementedHealthzServer) mustEmbedUnimplementedHealthzServer() {}
func (UnimplementedHealthzServer) testEmbeddedByValue() {}
// UnsafeHealthzServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to HealthzServer will
// result in compilation errors.
type UnsafeHealthzServer interface {
mustEmbedUnimplementedHealthzServer()
}
func RegisterHealthzServer(s grpc.ServiceRegistrar, srv HealthzServer) {
// If the following call panics, it indicates UnimplementedHealthzServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Healthz_ServiceDesc, srv)
}
func _Healthz_Check_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(HealthzServer).Check(&grpc.GenericServerStream[Health, Health]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Healthz_CheckServer = grpc.BidiStreamingServer[Health, Health]
// Healthz_ServiceDesc is the grpc.ServiceDesc for Healthz service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Healthz_ServiceDesc = grpc.ServiceDesc{
ServiceName: "arke.Healthz",
HandlerType: (*HealthzServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Check",
Handler: _Healthz_Check_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "arke.proto",
}