service_grpc.pb.go raw
1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 // versions:
3 // - protoc-gen-go-grpc v1.6.0
4 // - protoc (unknown)
5 // source: orlysync/negentropy/v1/service.proto
6
7 package negentropyv1
8
9 import (
10 context "context"
11 grpc "google.golang.org/grpc"
12 codes "google.golang.org/grpc/codes"
13 status "google.golang.org/grpc/status"
14 v1 "next.orly.dev/pkg/proto/orlysync/common/v1"
15 )
16
17 // This is a compile-time assertion to ensure that this generated file
18 // is compatible with the grpc package it is being compiled against.
19 // Requires gRPC-Go v1.64.0 or later.
20 const _ = grpc.SupportPackageIsVersion9
21
22 const (
23 NegentropyService_Ready_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Ready"
24 NegentropyService_Start_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Start"
25 NegentropyService_Stop_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Stop"
26 NegentropyService_HandleNegOpen_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegOpen"
27 NegentropyService_HandleNegMsg_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegMsg"
28 NegentropyService_HandleNegClose_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegClose"
29 NegentropyService_SyncWithPeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/SyncWithPeer"
30 NegentropyService_GetSyncStatus_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetSyncStatus"
31 NegentropyService_GetPeers_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetPeers"
32 NegentropyService_AddPeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/AddPeer"
33 NegentropyService_RemovePeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/RemovePeer"
34 NegentropyService_TriggerSync_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/TriggerSync"
35 NegentropyService_GetPeerSyncState_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetPeerSyncState"
36 NegentropyService_ListSessions_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/ListSessions"
37 NegentropyService_CloseSession_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/CloseSession"
38 )
39
40 // NegentropyServiceClient is the client API for NegentropyService service.
41 //
42 // 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.
43 //
44 // NegentropyService provides NIP-77 negentropy-based set reconciliation
45 // for both relay-to-relay sync and client-facing WebSocket operations
46 type NegentropyServiceClient interface {
47 // Ready returns whether the service is ready to serve requests
48 Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error)
49 // Start starts the background relay-to-relay sync
50 Start(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
51 // Stop stops the background sync
52 Stop(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
53 // HandleNegOpen processes a NEG-OPEN message from a client
54 HandleNegOpen(ctx context.Context, in *NegOpenRequest, opts ...grpc.CallOption) (*NegOpenResponse, error)
55 // HandleNegMsg processes a NEG-MSG message from a client
56 HandleNegMsg(ctx context.Context, in *NegMsgRequest, opts ...grpc.CallOption) (*NegMsgResponse, error)
57 // HandleNegClose processes a NEG-CLOSE message from a client
58 HandleNegClose(ctx context.Context, in *NegCloseRequest, opts ...grpc.CallOption) (*v1.Empty, error)
59 // SyncWithPeer initiates negentropy sync with a specific peer relay
60 SyncWithPeer(ctx context.Context, in *SyncPeerRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncProgress], error)
61 // GetSyncStatus returns the current sync status
62 GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error)
63 // GetPeers returns the list of negentropy sync peers
64 GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error)
65 // AddPeer adds a peer for negentropy sync
66 AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*v1.Empty, error)
67 // RemovePeer removes a peer from negentropy sync
68 RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*v1.Empty, error)
69 // TriggerSync manually triggers sync with a specific peer or all peers
70 TriggerSync(ctx context.Context, in *TriggerSyncRequest, opts ...grpc.CallOption) (*v1.Empty, error)
71 // GetPeerSyncState returns sync state for a specific peer
72 GetPeerSyncState(ctx context.Context, in *PeerSyncStateRequest, opts ...grpc.CallOption) (*PeerSyncStateResponse, error)
73 // ListSessions returns active client negentropy sessions
74 ListSessions(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*ListSessionsResponse, error)
75 // CloseSession forcefully closes a client session
76 CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*v1.Empty, error)
77 }
78
79 type negentropyServiceClient struct {
80 cc grpc.ClientConnInterface
81 }
82
83 func NewNegentropyServiceClient(cc grpc.ClientConnInterface) NegentropyServiceClient {
84 return &negentropyServiceClient{cc}
85 }
86
87 func (c *negentropyServiceClient) Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error) {
88 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
89 out := new(v1.ReadyResponse)
90 err := c.cc.Invoke(ctx, NegentropyService_Ready_FullMethodName, in, out, cOpts...)
91 if err != nil {
92 return nil, err
93 }
94 return out, nil
95 }
96
97 func (c *negentropyServiceClient) Start(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
98 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
99 out := new(v1.Empty)
100 err := c.cc.Invoke(ctx, NegentropyService_Start_FullMethodName, in, out, cOpts...)
101 if err != nil {
102 return nil, err
103 }
104 return out, nil
105 }
106
107 func (c *negentropyServiceClient) Stop(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
108 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
109 out := new(v1.Empty)
110 err := c.cc.Invoke(ctx, NegentropyService_Stop_FullMethodName, in, out, cOpts...)
111 if err != nil {
112 return nil, err
113 }
114 return out, nil
115 }
116
117 func (c *negentropyServiceClient) HandleNegOpen(ctx context.Context, in *NegOpenRequest, opts ...grpc.CallOption) (*NegOpenResponse, error) {
118 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
119 out := new(NegOpenResponse)
120 err := c.cc.Invoke(ctx, NegentropyService_HandleNegOpen_FullMethodName, in, out, cOpts...)
121 if err != nil {
122 return nil, err
123 }
124 return out, nil
125 }
126
127 func (c *negentropyServiceClient) HandleNegMsg(ctx context.Context, in *NegMsgRequest, opts ...grpc.CallOption) (*NegMsgResponse, error) {
128 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
129 out := new(NegMsgResponse)
130 err := c.cc.Invoke(ctx, NegentropyService_HandleNegMsg_FullMethodName, in, out, cOpts...)
131 if err != nil {
132 return nil, err
133 }
134 return out, nil
135 }
136
137 func (c *negentropyServiceClient) HandleNegClose(ctx context.Context, in *NegCloseRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
138 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
139 out := new(v1.Empty)
140 err := c.cc.Invoke(ctx, NegentropyService_HandleNegClose_FullMethodName, in, out, cOpts...)
141 if err != nil {
142 return nil, err
143 }
144 return out, nil
145 }
146
147 func (c *negentropyServiceClient) SyncWithPeer(ctx context.Context, in *SyncPeerRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncProgress], error) {
148 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
149 stream, err := c.cc.NewStream(ctx, &NegentropyService_ServiceDesc.Streams[0], NegentropyService_SyncWithPeer_FullMethodName, cOpts...)
150 if err != nil {
151 return nil, err
152 }
153 x := &grpc.GenericClientStream[SyncPeerRequest, SyncProgress]{ClientStream: stream}
154 if err := x.ClientStream.SendMsg(in); err != nil {
155 return nil, err
156 }
157 if err := x.ClientStream.CloseSend(); err != nil {
158 return nil, err
159 }
160 return x, nil
161 }
162
163 // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
164 type NegentropyService_SyncWithPeerClient = grpc.ServerStreamingClient[SyncProgress]
165
166 func (c *negentropyServiceClient) GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error) {
167 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
168 out := new(SyncStatusResponse)
169 err := c.cc.Invoke(ctx, NegentropyService_GetSyncStatus_FullMethodName, in, out, cOpts...)
170 if err != nil {
171 return nil, err
172 }
173 return out, nil
174 }
175
176 func (c *negentropyServiceClient) GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error) {
177 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
178 out := new(PeersResponse)
179 err := c.cc.Invoke(ctx, NegentropyService_GetPeers_FullMethodName, in, out, cOpts...)
180 if err != nil {
181 return nil, err
182 }
183 return out, nil
184 }
185
186 func (c *negentropyServiceClient) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
187 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
188 out := new(v1.Empty)
189 err := c.cc.Invoke(ctx, NegentropyService_AddPeer_FullMethodName, in, out, cOpts...)
190 if err != nil {
191 return nil, err
192 }
193 return out, nil
194 }
195
196 func (c *negentropyServiceClient) RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
197 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
198 out := new(v1.Empty)
199 err := c.cc.Invoke(ctx, NegentropyService_RemovePeer_FullMethodName, in, out, cOpts...)
200 if err != nil {
201 return nil, err
202 }
203 return out, nil
204 }
205
206 func (c *negentropyServiceClient) TriggerSync(ctx context.Context, in *TriggerSyncRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
207 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
208 out := new(v1.Empty)
209 err := c.cc.Invoke(ctx, NegentropyService_TriggerSync_FullMethodName, in, out, cOpts...)
210 if err != nil {
211 return nil, err
212 }
213 return out, nil
214 }
215
216 func (c *negentropyServiceClient) GetPeerSyncState(ctx context.Context, in *PeerSyncStateRequest, opts ...grpc.CallOption) (*PeerSyncStateResponse, error) {
217 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
218 out := new(PeerSyncStateResponse)
219 err := c.cc.Invoke(ctx, NegentropyService_GetPeerSyncState_FullMethodName, in, out, cOpts...)
220 if err != nil {
221 return nil, err
222 }
223 return out, nil
224 }
225
226 func (c *negentropyServiceClient) ListSessions(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*ListSessionsResponse, error) {
227 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
228 out := new(ListSessionsResponse)
229 err := c.cc.Invoke(ctx, NegentropyService_ListSessions_FullMethodName, in, out, cOpts...)
230 if err != nil {
231 return nil, err
232 }
233 return out, nil
234 }
235
236 func (c *negentropyServiceClient) CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
237 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
238 out := new(v1.Empty)
239 err := c.cc.Invoke(ctx, NegentropyService_CloseSession_FullMethodName, in, out, cOpts...)
240 if err != nil {
241 return nil, err
242 }
243 return out, nil
244 }
245
246 // NegentropyServiceServer is the server API for NegentropyService service.
247 // All implementations must embed UnimplementedNegentropyServiceServer
248 // for forward compatibility.
249 //
250 // NegentropyService provides NIP-77 negentropy-based set reconciliation
251 // for both relay-to-relay sync and client-facing WebSocket operations
252 type NegentropyServiceServer interface {
253 // Ready returns whether the service is ready to serve requests
254 Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error)
255 // Start starts the background relay-to-relay sync
256 Start(context.Context, *v1.Empty) (*v1.Empty, error)
257 // Stop stops the background sync
258 Stop(context.Context, *v1.Empty) (*v1.Empty, error)
259 // HandleNegOpen processes a NEG-OPEN message from a client
260 HandleNegOpen(context.Context, *NegOpenRequest) (*NegOpenResponse, error)
261 // HandleNegMsg processes a NEG-MSG message from a client
262 HandleNegMsg(context.Context, *NegMsgRequest) (*NegMsgResponse, error)
263 // HandleNegClose processes a NEG-CLOSE message from a client
264 HandleNegClose(context.Context, *NegCloseRequest) (*v1.Empty, error)
265 // SyncWithPeer initiates negentropy sync with a specific peer relay
266 SyncWithPeer(*SyncPeerRequest, grpc.ServerStreamingServer[SyncProgress]) error
267 // GetSyncStatus returns the current sync status
268 GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error)
269 // GetPeers returns the list of negentropy sync peers
270 GetPeers(context.Context, *v1.Empty) (*PeersResponse, error)
271 // AddPeer adds a peer for negentropy sync
272 AddPeer(context.Context, *AddPeerRequest) (*v1.Empty, error)
273 // RemovePeer removes a peer from negentropy sync
274 RemovePeer(context.Context, *RemovePeerRequest) (*v1.Empty, error)
275 // TriggerSync manually triggers sync with a specific peer or all peers
276 TriggerSync(context.Context, *TriggerSyncRequest) (*v1.Empty, error)
277 // GetPeerSyncState returns sync state for a specific peer
278 GetPeerSyncState(context.Context, *PeerSyncStateRequest) (*PeerSyncStateResponse, error)
279 // ListSessions returns active client negentropy sessions
280 ListSessions(context.Context, *v1.Empty) (*ListSessionsResponse, error)
281 // CloseSession forcefully closes a client session
282 CloseSession(context.Context, *CloseSessionRequest) (*v1.Empty, error)
283 mustEmbedUnimplementedNegentropyServiceServer()
284 }
285
286 // UnimplementedNegentropyServiceServer must be embedded to have
287 // forward compatible implementations.
288 //
289 // NOTE: this should be embedded by value instead of pointer to avoid a nil
290 // pointer dereference when methods are called.
291 type UnimplementedNegentropyServiceServer struct{}
292
293 func (UnimplementedNegentropyServiceServer) Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) {
294 return nil, status.Error(codes.Unimplemented, "method Ready not implemented")
295 }
296 func (UnimplementedNegentropyServiceServer) Start(context.Context, *v1.Empty) (*v1.Empty, error) {
297 return nil, status.Error(codes.Unimplemented, "method Start not implemented")
298 }
299 func (UnimplementedNegentropyServiceServer) Stop(context.Context, *v1.Empty) (*v1.Empty, error) {
300 return nil, status.Error(codes.Unimplemented, "method Stop not implemented")
301 }
302 func (UnimplementedNegentropyServiceServer) HandleNegOpen(context.Context, *NegOpenRequest) (*NegOpenResponse, error) {
303 return nil, status.Error(codes.Unimplemented, "method HandleNegOpen not implemented")
304 }
305 func (UnimplementedNegentropyServiceServer) HandleNegMsg(context.Context, *NegMsgRequest) (*NegMsgResponse, error) {
306 return nil, status.Error(codes.Unimplemented, "method HandleNegMsg not implemented")
307 }
308 func (UnimplementedNegentropyServiceServer) HandleNegClose(context.Context, *NegCloseRequest) (*v1.Empty, error) {
309 return nil, status.Error(codes.Unimplemented, "method HandleNegClose not implemented")
310 }
311 func (UnimplementedNegentropyServiceServer) SyncWithPeer(*SyncPeerRequest, grpc.ServerStreamingServer[SyncProgress]) error {
312 return status.Error(codes.Unimplemented, "method SyncWithPeer not implemented")
313 }
314 func (UnimplementedNegentropyServiceServer) GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error) {
315 return nil, status.Error(codes.Unimplemented, "method GetSyncStatus not implemented")
316 }
317 func (UnimplementedNegentropyServiceServer) GetPeers(context.Context, *v1.Empty) (*PeersResponse, error) {
318 return nil, status.Error(codes.Unimplemented, "method GetPeers not implemented")
319 }
320 func (UnimplementedNegentropyServiceServer) AddPeer(context.Context, *AddPeerRequest) (*v1.Empty, error) {
321 return nil, status.Error(codes.Unimplemented, "method AddPeer not implemented")
322 }
323 func (UnimplementedNegentropyServiceServer) RemovePeer(context.Context, *RemovePeerRequest) (*v1.Empty, error) {
324 return nil, status.Error(codes.Unimplemented, "method RemovePeer not implemented")
325 }
326 func (UnimplementedNegentropyServiceServer) TriggerSync(context.Context, *TriggerSyncRequest) (*v1.Empty, error) {
327 return nil, status.Error(codes.Unimplemented, "method TriggerSync not implemented")
328 }
329 func (UnimplementedNegentropyServiceServer) GetPeerSyncState(context.Context, *PeerSyncStateRequest) (*PeerSyncStateResponse, error) {
330 return nil, status.Error(codes.Unimplemented, "method GetPeerSyncState not implemented")
331 }
332 func (UnimplementedNegentropyServiceServer) ListSessions(context.Context, *v1.Empty) (*ListSessionsResponse, error) {
333 return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented")
334 }
335 func (UnimplementedNegentropyServiceServer) CloseSession(context.Context, *CloseSessionRequest) (*v1.Empty, error) {
336 return nil, status.Error(codes.Unimplemented, "method CloseSession not implemented")
337 }
338 func (UnimplementedNegentropyServiceServer) mustEmbedUnimplementedNegentropyServiceServer() {}
339 func (UnimplementedNegentropyServiceServer) testEmbeddedByValue() {}
340
341 // UnsafeNegentropyServiceServer may be embedded to opt out of forward compatibility for this service.
342 // Use of this interface is not recommended, as added methods to NegentropyServiceServer will
343 // result in compilation errors.
344 type UnsafeNegentropyServiceServer interface {
345 mustEmbedUnimplementedNegentropyServiceServer()
346 }
347
348 func RegisterNegentropyServiceServer(s grpc.ServiceRegistrar, srv NegentropyServiceServer) {
349 // If the following call panics, it indicates UnimplementedNegentropyServiceServer was
350 // embedded by pointer and is nil. This will cause panics if an
351 // unimplemented method is ever invoked, so we test this at initialization
352 // time to prevent it from happening at runtime later due to I/O.
353 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
354 t.testEmbeddedByValue()
355 }
356 s.RegisterService(&NegentropyService_ServiceDesc, srv)
357 }
358
359 func _NegentropyService_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
360 in := new(v1.Empty)
361 if err := dec(in); err != nil {
362 return nil, err
363 }
364 if interceptor == nil {
365 return srv.(NegentropyServiceServer).Ready(ctx, in)
366 }
367 info := &grpc.UnaryServerInfo{
368 Server: srv,
369 FullMethod: NegentropyService_Ready_FullMethodName,
370 }
371 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
372 return srv.(NegentropyServiceServer).Ready(ctx, req.(*v1.Empty))
373 }
374 return interceptor(ctx, in, info, handler)
375 }
376
377 func _NegentropyService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
378 in := new(v1.Empty)
379 if err := dec(in); err != nil {
380 return nil, err
381 }
382 if interceptor == nil {
383 return srv.(NegentropyServiceServer).Start(ctx, in)
384 }
385 info := &grpc.UnaryServerInfo{
386 Server: srv,
387 FullMethod: NegentropyService_Start_FullMethodName,
388 }
389 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
390 return srv.(NegentropyServiceServer).Start(ctx, req.(*v1.Empty))
391 }
392 return interceptor(ctx, in, info, handler)
393 }
394
395 func _NegentropyService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
396 in := new(v1.Empty)
397 if err := dec(in); err != nil {
398 return nil, err
399 }
400 if interceptor == nil {
401 return srv.(NegentropyServiceServer).Stop(ctx, in)
402 }
403 info := &grpc.UnaryServerInfo{
404 Server: srv,
405 FullMethod: NegentropyService_Stop_FullMethodName,
406 }
407 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
408 return srv.(NegentropyServiceServer).Stop(ctx, req.(*v1.Empty))
409 }
410 return interceptor(ctx, in, info, handler)
411 }
412
413 func _NegentropyService_HandleNegOpen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
414 in := new(NegOpenRequest)
415 if err := dec(in); err != nil {
416 return nil, err
417 }
418 if interceptor == nil {
419 return srv.(NegentropyServiceServer).HandleNegOpen(ctx, in)
420 }
421 info := &grpc.UnaryServerInfo{
422 Server: srv,
423 FullMethod: NegentropyService_HandleNegOpen_FullMethodName,
424 }
425 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
426 return srv.(NegentropyServiceServer).HandleNegOpen(ctx, req.(*NegOpenRequest))
427 }
428 return interceptor(ctx, in, info, handler)
429 }
430
431 func _NegentropyService_HandleNegMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
432 in := new(NegMsgRequest)
433 if err := dec(in); err != nil {
434 return nil, err
435 }
436 if interceptor == nil {
437 return srv.(NegentropyServiceServer).HandleNegMsg(ctx, in)
438 }
439 info := &grpc.UnaryServerInfo{
440 Server: srv,
441 FullMethod: NegentropyService_HandleNegMsg_FullMethodName,
442 }
443 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
444 return srv.(NegentropyServiceServer).HandleNegMsg(ctx, req.(*NegMsgRequest))
445 }
446 return interceptor(ctx, in, info, handler)
447 }
448
449 func _NegentropyService_HandleNegClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
450 in := new(NegCloseRequest)
451 if err := dec(in); err != nil {
452 return nil, err
453 }
454 if interceptor == nil {
455 return srv.(NegentropyServiceServer).HandleNegClose(ctx, in)
456 }
457 info := &grpc.UnaryServerInfo{
458 Server: srv,
459 FullMethod: NegentropyService_HandleNegClose_FullMethodName,
460 }
461 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
462 return srv.(NegentropyServiceServer).HandleNegClose(ctx, req.(*NegCloseRequest))
463 }
464 return interceptor(ctx, in, info, handler)
465 }
466
467 func _NegentropyService_SyncWithPeer_Handler(srv interface{}, stream grpc.ServerStream) error {
468 m := new(SyncPeerRequest)
469 if err := stream.RecvMsg(m); err != nil {
470 return err
471 }
472 return srv.(NegentropyServiceServer).SyncWithPeer(m, &grpc.GenericServerStream[SyncPeerRequest, SyncProgress]{ServerStream: stream})
473 }
474
475 // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
476 type NegentropyService_SyncWithPeerServer = grpc.ServerStreamingServer[SyncProgress]
477
478 func _NegentropyService_GetSyncStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
479 in := new(v1.Empty)
480 if err := dec(in); err != nil {
481 return nil, err
482 }
483 if interceptor == nil {
484 return srv.(NegentropyServiceServer).GetSyncStatus(ctx, in)
485 }
486 info := &grpc.UnaryServerInfo{
487 Server: srv,
488 FullMethod: NegentropyService_GetSyncStatus_FullMethodName,
489 }
490 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
491 return srv.(NegentropyServiceServer).GetSyncStatus(ctx, req.(*v1.Empty))
492 }
493 return interceptor(ctx, in, info, handler)
494 }
495
496 func _NegentropyService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
497 in := new(v1.Empty)
498 if err := dec(in); err != nil {
499 return nil, err
500 }
501 if interceptor == nil {
502 return srv.(NegentropyServiceServer).GetPeers(ctx, in)
503 }
504 info := &grpc.UnaryServerInfo{
505 Server: srv,
506 FullMethod: NegentropyService_GetPeers_FullMethodName,
507 }
508 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
509 return srv.(NegentropyServiceServer).GetPeers(ctx, req.(*v1.Empty))
510 }
511 return interceptor(ctx, in, info, handler)
512 }
513
514 func _NegentropyService_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
515 in := new(AddPeerRequest)
516 if err := dec(in); err != nil {
517 return nil, err
518 }
519 if interceptor == nil {
520 return srv.(NegentropyServiceServer).AddPeer(ctx, in)
521 }
522 info := &grpc.UnaryServerInfo{
523 Server: srv,
524 FullMethod: NegentropyService_AddPeer_FullMethodName,
525 }
526 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
527 return srv.(NegentropyServiceServer).AddPeer(ctx, req.(*AddPeerRequest))
528 }
529 return interceptor(ctx, in, info, handler)
530 }
531
532 func _NegentropyService_RemovePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
533 in := new(RemovePeerRequest)
534 if err := dec(in); err != nil {
535 return nil, err
536 }
537 if interceptor == nil {
538 return srv.(NegentropyServiceServer).RemovePeer(ctx, in)
539 }
540 info := &grpc.UnaryServerInfo{
541 Server: srv,
542 FullMethod: NegentropyService_RemovePeer_FullMethodName,
543 }
544 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
545 return srv.(NegentropyServiceServer).RemovePeer(ctx, req.(*RemovePeerRequest))
546 }
547 return interceptor(ctx, in, info, handler)
548 }
549
550 func _NegentropyService_TriggerSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
551 in := new(TriggerSyncRequest)
552 if err := dec(in); err != nil {
553 return nil, err
554 }
555 if interceptor == nil {
556 return srv.(NegentropyServiceServer).TriggerSync(ctx, in)
557 }
558 info := &grpc.UnaryServerInfo{
559 Server: srv,
560 FullMethod: NegentropyService_TriggerSync_FullMethodName,
561 }
562 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
563 return srv.(NegentropyServiceServer).TriggerSync(ctx, req.(*TriggerSyncRequest))
564 }
565 return interceptor(ctx, in, info, handler)
566 }
567
568 func _NegentropyService_GetPeerSyncState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
569 in := new(PeerSyncStateRequest)
570 if err := dec(in); err != nil {
571 return nil, err
572 }
573 if interceptor == nil {
574 return srv.(NegentropyServiceServer).GetPeerSyncState(ctx, in)
575 }
576 info := &grpc.UnaryServerInfo{
577 Server: srv,
578 FullMethod: NegentropyService_GetPeerSyncState_FullMethodName,
579 }
580 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
581 return srv.(NegentropyServiceServer).GetPeerSyncState(ctx, req.(*PeerSyncStateRequest))
582 }
583 return interceptor(ctx, in, info, handler)
584 }
585
586 func _NegentropyService_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
587 in := new(v1.Empty)
588 if err := dec(in); err != nil {
589 return nil, err
590 }
591 if interceptor == nil {
592 return srv.(NegentropyServiceServer).ListSessions(ctx, in)
593 }
594 info := &grpc.UnaryServerInfo{
595 Server: srv,
596 FullMethod: NegentropyService_ListSessions_FullMethodName,
597 }
598 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
599 return srv.(NegentropyServiceServer).ListSessions(ctx, req.(*v1.Empty))
600 }
601 return interceptor(ctx, in, info, handler)
602 }
603
604 func _NegentropyService_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
605 in := new(CloseSessionRequest)
606 if err := dec(in); err != nil {
607 return nil, err
608 }
609 if interceptor == nil {
610 return srv.(NegentropyServiceServer).CloseSession(ctx, in)
611 }
612 info := &grpc.UnaryServerInfo{
613 Server: srv,
614 FullMethod: NegentropyService_CloseSession_FullMethodName,
615 }
616 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
617 return srv.(NegentropyServiceServer).CloseSession(ctx, req.(*CloseSessionRequest))
618 }
619 return interceptor(ctx, in, info, handler)
620 }
621
622 // NegentropyService_ServiceDesc is the grpc.ServiceDesc for NegentropyService service.
623 // It's only intended for direct use with grpc.RegisterService,
624 // and not to be introspected or modified (even as a copy)
625 var NegentropyService_ServiceDesc = grpc.ServiceDesc{
626 ServiceName: "orlysync.negentropy.v1.NegentropyService",
627 HandlerType: (*NegentropyServiceServer)(nil),
628 Methods: []grpc.MethodDesc{
629 {
630 MethodName: "Ready",
631 Handler: _NegentropyService_Ready_Handler,
632 },
633 {
634 MethodName: "Start",
635 Handler: _NegentropyService_Start_Handler,
636 },
637 {
638 MethodName: "Stop",
639 Handler: _NegentropyService_Stop_Handler,
640 },
641 {
642 MethodName: "HandleNegOpen",
643 Handler: _NegentropyService_HandleNegOpen_Handler,
644 },
645 {
646 MethodName: "HandleNegMsg",
647 Handler: _NegentropyService_HandleNegMsg_Handler,
648 },
649 {
650 MethodName: "HandleNegClose",
651 Handler: _NegentropyService_HandleNegClose_Handler,
652 },
653 {
654 MethodName: "GetSyncStatus",
655 Handler: _NegentropyService_GetSyncStatus_Handler,
656 },
657 {
658 MethodName: "GetPeers",
659 Handler: _NegentropyService_GetPeers_Handler,
660 },
661 {
662 MethodName: "AddPeer",
663 Handler: _NegentropyService_AddPeer_Handler,
664 },
665 {
666 MethodName: "RemovePeer",
667 Handler: _NegentropyService_RemovePeer_Handler,
668 },
669 {
670 MethodName: "TriggerSync",
671 Handler: _NegentropyService_TriggerSync_Handler,
672 },
673 {
674 MethodName: "GetPeerSyncState",
675 Handler: _NegentropyService_GetPeerSyncState_Handler,
676 },
677 {
678 MethodName: "ListSessions",
679 Handler: _NegentropyService_ListSessions_Handler,
680 },
681 {
682 MethodName: "CloseSession",
683 Handler: _NegentropyService_CloseSession_Handler,
684 },
685 },
686 Streams: []grpc.StreamDesc{
687 {
688 StreamName: "SyncWithPeer",
689 Handler: _NegentropyService_SyncWithPeer_Handler,
690 ServerStreams: true,
691 },
692 },
693 Metadata: "orlysync/negentropy/v1/service.proto",
694 }
695