-
Notifications
You must be signed in to change notification settings - Fork 0
/
gopaxos_grpc.pb.go
493 lines (445 loc) · 16.9 KB
/
gopaxos_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
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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.4
// source: gopaxos.proto
package __
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
// ReplicaClient is the client API for Replica 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 ReplicaClient interface {
Write(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Read(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Collect(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Decide(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}
type replicaClient struct {
cc grpc.ClientConnInterface
}
func NewReplicaClient(cc grpc.ClientConnInterface) ReplicaClient {
return &replicaClient{cc}
}
func (c *replicaClient) Write(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.Replica/Write", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicaClient) Read(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.Replica/Read", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicaClient) Collect(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.Replica/Collect", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicaClient) Decide(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.Replica/Decide", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ReplicaServer is the server API for Replica service.
// All implementations must embed UnimplementedReplicaServer
// for forward compatibility
type ReplicaServer interface {
Write(context.Context, *Message) (*Message, error)
Read(context.Context, *Message) (*Message, error)
Collect(context.Context, *Message) (*Message, error)
Decide(context.Context, *Message) (*Message, error)
mustEmbedUnimplementedReplicaServer()
}
// UnimplementedReplicaServer must be embedded to have forward compatible implementations.
type UnimplementedReplicaServer struct {
}
func (UnimplementedReplicaServer) Write(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Write not implemented")
}
func (UnimplementedReplicaServer) Read(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Read not implemented")
}
func (UnimplementedReplicaServer) Collect(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Collect not implemented")
}
func (UnimplementedReplicaServer) Decide(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Decide not implemented")
}
func (UnimplementedReplicaServer) mustEmbedUnimplementedReplicaServer() {}
// UnsafeReplicaServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ReplicaServer will
// result in compilation errors.
type UnsafeReplicaServer interface {
mustEmbedUnimplementedReplicaServer()
}
func RegisterReplicaServer(s grpc.ServiceRegistrar, srv ReplicaServer) {
s.RegisterService(&Replica_ServiceDesc, srv)
}
func _Replica_Write_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.(ReplicaServer).Write(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.Replica/Write",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaServer).Write(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _Replica_Read_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.(ReplicaServer).Read(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.Replica/Read",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaServer).Read(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _Replica_Collect_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.(ReplicaServer).Collect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.Replica/Collect",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaServer).Collect(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _Replica_Decide_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.(ReplicaServer).Decide(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.Replica/Decide",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaServer).Decide(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
// Replica_ServiceDesc is the grpc.ServiceDesc for Replica service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Replica_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gopaxos.Replica",
HandlerType: (*ReplicaServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Write",
Handler: _Replica_Write_Handler,
},
{
MethodName: "Read",
Handler: _Replica_Read_Handler,
},
{
MethodName: "Collect",
Handler: _Replica_Collect_Handler,
},
{
MethodName: "Decide",
Handler: _Replica_Decide_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "gopaxos.proto",
}
// ReplicaLeaderClient is the client API for ReplicaLeader 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 ReplicaLeaderClient interface {
Propose(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Collect(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Heartbeat(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}
type replicaLeaderClient struct {
cc grpc.ClientConnInterface
}
func NewReplicaLeaderClient(cc grpc.ClientConnInterface) ReplicaLeaderClient {
return &replicaLeaderClient{cc}
}
func (c *replicaLeaderClient) Propose(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.ReplicaLeader/Propose", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicaLeaderClient) Collect(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.ReplicaLeader/Collect", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicaLeaderClient) Heartbeat(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.ReplicaLeader/Heartbeat", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ReplicaLeaderServer is the server API for ReplicaLeader service.
// All implementations must embed UnimplementedReplicaLeaderServer
// for forward compatibility
type ReplicaLeaderServer interface {
Propose(context.Context, *Message) (*Message, error)
Collect(context.Context, *Message) (*Message, error)
Heartbeat(context.Context, *Message) (*Message, error)
mustEmbedUnimplementedReplicaLeaderServer()
}
// UnimplementedReplicaLeaderServer must be embedded to have forward compatible implementations.
type UnimplementedReplicaLeaderServer struct {
}
func (UnimplementedReplicaLeaderServer) Propose(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Propose not implemented")
}
func (UnimplementedReplicaLeaderServer) Collect(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Collect not implemented")
}
func (UnimplementedReplicaLeaderServer) Heartbeat(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented")
}
func (UnimplementedReplicaLeaderServer) mustEmbedUnimplementedReplicaLeaderServer() {}
// UnsafeReplicaLeaderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ReplicaLeaderServer will
// result in compilation errors.
type UnsafeReplicaLeaderServer interface {
mustEmbedUnimplementedReplicaLeaderServer()
}
func RegisterReplicaLeaderServer(s grpc.ServiceRegistrar, srv ReplicaLeaderServer) {
s.RegisterService(&ReplicaLeader_ServiceDesc, srv)
}
func _ReplicaLeader_Propose_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.(ReplicaLeaderServer).Propose(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.ReplicaLeader/Propose",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaLeaderServer).Propose(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _ReplicaLeader_Collect_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.(ReplicaLeaderServer).Collect(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.ReplicaLeader/Collect",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaLeaderServer).Collect(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _ReplicaLeader_Heartbeat_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.(ReplicaLeaderServer).Heartbeat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.ReplicaLeader/Heartbeat",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicaLeaderServer).Heartbeat(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
// ReplicaLeader_ServiceDesc is the grpc.ServiceDesc for ReplicaLeader service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ReplicaLeader_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gopaxos.ReplicaLeader",
HandlerType: (*ReplicaLeaderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Propose",
Handler: _ReplicaLeader_Propose_Handler,
},
{
MethodName: "Collect",
Handler: _ReplicaLeader_Collect_Handler,
},
{
MethodName: "Heartbeat",
Handler: _ReplicaLeader_Heartbeat_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "gopaxos.proto",
}
// LeaderAcceptorClient is the client API for LeaderAcceptor 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 LeaderAcceptorClient interface {
Scouting(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Commanding(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}
type leaderAcceptorClient struct {
cc grpc.ClientConnInterface
}
func NewLeaderAcceptorClient(cc grpc.ClientConnInterface) LeaderAcceptorClient {
return &leaderAcceptorClient{cc}
}
func (c *leaderAcceptorClient) Scouting(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.LeaderAcceptor/Scouting", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *leaderAcceptorClient) Commanding(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
out := new(Message)
err := c.cc.Invoke(ctx, "/gopaxos.LeaderAcceptor/Commanding", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// LeaderAcceptorServer is the server API for LeaderAcceptor service.
// All implementations must embed UnimplementedLeaderAcceptorServer
// for forward compatibility
type LeaderAcceptorServer interface {
Scouting(context.Context, *Message) (*Message, error)
Commanding(context.Context, *Message) (*Message, error)
mustEmbedUnimplementedLeaderAcceptorServer()
}
// UnimplementedLeaderAcceptorServer must be embedded to have forward compatible implementations.
type UnimplementedLeaderAcceptorServer struct {
}
func (UnimplementedLeaderAcceptorServer) Scouting(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Scouting not implemented")
}
func (UnimplementedLeaderAcceptorServer) Commanding(context.Context, *Message) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method Commanding not implemented")
}
func (UnimplementedLeaderAcceptorServer) mustEmbedUnimplementedLeaderAcceptorServer() {}
// UnsafeLeaderAcceptorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LeaderAcceptorServer will
// result in compilation errors.
type UnsafeLeaderAcceptorServer interface {
mustEmbedUnimplementedLeaderAcceptorServer()
}
func RegisterLeaderAcceptorServer(s grpc.ServiceRegistrar, srv LeaderAcceptorServer) {
s.RegisterService(&LeaderAcceptor_ServiceDesc, srv)
}
func _LeaderAcceptor_Scouting_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.(LeaderAcceptorServer).Scouting(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.LeaderAcceptor/Scouting",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LeaderAcceptorServer).Scouting(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
func _LeaderAcceptor_Commanding_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.(LeaderAcceptorServer).Commanding(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gopaxos.LeaderAcceptor/Commanding",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LeaderAcceptorServer).Commanding(ctx, req.(*Message))
}
return interceptor(ctx, in, info, handler)
}
// LeaderAcceptor_ServiceDesc is the grpc.ServiceDesc for LeaderAcceptor service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LeaderAcceptor_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gopaxos.LeaderAcceptor",
HandlerType: (*LeaderAcceptorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Scouting",
Handler: _LeaderAcceptor_Scouting_Handler,
},
{
MethodName: "Commanding",
Handler: _LeaderAcceptor_Commanding_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "gopaxos.proto",
}