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/distributed/v1/service.proto
6
7 package distributedv1
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 DistributedSyncService_Ready_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/Ready"
24 DistributedSyncService_GetInfo_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetInfo"
25 DistributedSyncService_GetCurrentSerial_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetCurrentSerial"
26 DistributedSyncService_GetEventIDs_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetEventIDs"
27 DistributedSyncService_HandleCurrentRequest_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/HandleCurrentRequest"
28 DistributedSyncService_HandleEventIDsRequest_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/HandleEventIDsRequest"
29 DistributedSyncService_GetPeers_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetPeers"
30 DistributedSyncService_UpdatePeers_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/UpdatePeers"
31 DistributedSyncService_IsAuthorizedPeer_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/IsAuthorizedPeer"
32 DistributedSyncService_GetPeerPubkey_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetPeerPubkey"
33 DistributedSyncService_UpdateSerial_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/UpdateSerial"
34 DistributedSyncService_NotifyNewEvent_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/NotifyNewEvent"
35 DistributedSyncService_TriggerSync_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/TriggerSync"
36 DistributedSyncService_GetSyncStatus_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetSyncStatus"
37 )
38
39 // DistributedSyncServiceClient is the client API for DistributedSyncService service.
40 //
41 // 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.
42 //
43 // DistributedSyncService provides serial-based peer-to-peer synchronization
44 // between relay instances using HTTP polling
45 type DistributedSyncServiceClient interface {
46 // Ready returns whether the service is ready to serve requests
47 Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error)
48 // GetInfo returns current sync service information
49 GetInfo(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.SyncInfo, error)
50 // GetCurrentSerial returns this relay's current serial number
51 GetCurrentSerial(ctx context.Context, in *CurrentRequest, opts ...grpc.CallOption) (*CurrentResponse, error)
52 // GetEventIDs returns event IDs for a serial range
53 GetEventIDs(ctx context.Context, in *EventIDsRequest, opts ...grpc.CallOption) (*EventIDsResponse, error)
54 // HandleCurrentRequest proxies /api/sync/current HTTP requests
55 HandleCurrentRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error)
56 // HandleEventIDsRequest proxies /api/sync/event-ids HTTP requests
57 HandleEventIDsRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error)
58 // GetPeers returns the current list of sync peers
59 GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error)
60 // UpdatePeers updates the peer list
61 UpdatePeers(ctx context.Context, in *UpdatePeersRequest, opts ...grpc.CallOption) (*v1.Empty, error)
62 // IsAuthorizedPeer checks if a peer is authorized by validating its NIP-11 pubkey
63 IsAuthorizedPeer(ctx context.Context, in *AuthorizedPeerRequest, opts ...grpc.CallOption) (*AuthorizedPeerResponse, error)
64 // GetPeerPubkey fetches the pubkey for a peer relay via NIP-11
65 GetPeerPubkey(ctx context.Context, in *PeerPubkeyRequest, opts ...grpc.CallOption) (*PeerPubkeyResponse, error)
66 // UpdateSerial updates the current serial from database
67 UpdateSerial(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
68 // NotifyNewEvent notifies the service of a new event being stored
69 NotifyNewEvent(ctx context.Context, in *NewEventNotification, opts ...grpc.CallOption) (*v1.Empty, error)
70 // TriggerSync manually triggers a sync cycle with all peers
71 TriggerSync(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
72 // GetSyncStatus returns current sync status for all peers
73 GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error)
74 }
75
76 type distributedSyncServiceClient struct {
77 cc grpc.ClientConnInterface
78 }
79
80 func NewDistributedSyncServiceClient(cc grpc.ClientConnInterface) DistributedSyncServiceClient {
81 return &distributedSyncServiceClient{cc}
82 }
83
84 func (c *distributedSyncServiceClient) Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error) {
85 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
86 out := new(v1.ReadyResponse)
87 err := c.cc.Invoke(ctx, DistributedSyncService_Ready_FullMethodName, in, out, cOpts...)
88 if err != nil {
89 return nil, err
90 }
91 return out, nil
92 }
93
94 func (c *distributedSyncServiceClient) GetInfo(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.SyncInfo, error) {
95 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
96 out := new(v1.SyncInfo)
97 err := c.cc.Invoke(ctx, DistributedSyncService_GetInfo_FullMethodName, in, out, cOpts...)
98 if err != nil {
99 return nil, err
100 }
101 return out, nil
102 }
103
104 func (c *distributedSyncServiceClient) GetCurrentSerial(ctx context.Context, in *CurrentRequest, opts ...grpc.CallOption) (*CurrentResponse, error) {
105 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
106 out := new(CurrentResponse)
107 err := c.cc.Invoke(ctx, DistributedSyncService_GetCurrentSerial_FullMethodName, in, out, cOpts...)
108 if err != nil {
109 return nil, err
110 }
111 return out, nil
112 }
113
114 func (c *distributedSyncServiceClient) GetEventIDs(ctx context.Context, in *EventIDsRequest, opts ...grpc.CallOption) (*EventIDsResponse, error) {
115 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
116 out := new(EventIDsResponse)
117 err := c.cc.Invoke(ctx, DistributedSyncService_GetEventIDs_FullMethodName, in, out, cOpts...)
118 if err != nil {
119 return nil, err
120 }
121 return out, nil
122 }
123
124 func (c *distributedSyncServiceClient) HandleCurrentRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error) {
125 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
126 out := new(v1.HTTPResponse)
127 err := c.cc.Invoke(ctx, DistributedSyncService_HandleCurrentRequest_FullMethodName, in, out, cOpts...)
128 if err != nil {
129 return nil, err
130 }
131 return out, nil
132 }
133
134 func (c *distributedSyncServiceClient) HandleEventIDsRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error) {
135 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
136 out := new(v1.HTTPResponse)
137 err := c.cc.Invoke(ctx, DistributedSyncService_HandleEventIDsRequest_FullMethodName, in, out, cOpts...)
138 if err != nil {
139 return nil, err
140 }
141 return out, nil
142 }
143
144 func (c *distributedSyncServiceClient) GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error) {
145 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
146 out := new(PeersResponse)
147 err := c.cc.Invoke(ctx, DistributedSyncService_GetPeers_FullMethodName, in, out, cOpts...)
148 if err != nil {
149 return nil, err
150 }
151 return out, nil
152 }
153
154 func (c *distributedSyncServiceClient) UpdatePeers(ctx context.Context, in *UpdatePeersRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
155 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
156 out := new(v1.Empty)
157 err := c.cc.Invoke(ctx, DistributedSyncService_UpdatePeers_FullMethodName, in, out, cOpts...)
158 if err != nil {
159 return nil, err
160 }
161 return out, nil
162 }
163
164 func (c *distributedSyncServiceClient) IsAuthorizedPeer(ctx context.Context, in *AuthorizedPeerRequest, opts ...grpc.CallOption) (*AuthorizedPeerResponse, error) {
165 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
166 out := new(AuthorizedPeerResponse)
167 err := c.cc.Invoke(ctx, DistributedSyncService_IsAuthorizedPeer_FullMethodName, in, out, cOpts...)
168 if err != nil {
169 return nil, err
170 }
171 return out, nil
172 }
173
174 func (c *distributedSyncServiceClient) GetPeerPubkey(ctx context.Context, in *PeerPubkeyRequest, opts ...grpc.CallOption) (*PeerPubkeyResponse, error) {
175 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
176 out := new(PeerPubkeyResponse)
177 err := c.cc.Invoke(ctx, DistributedSyncService_GetPeerPubkey_FullMethodName, in, out, cOpts...)
178 if err != nil {
179 return nil, err
180 }
181 return out, nil
182 }
183
184 func (c *distributedSyncServiceClient) UpdateSerial(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
185 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
186 out := new(v1.Empty)
187 err := c.cc.Invoke(ctx, DistributedSyncService_UpdateSerial_FullMethodName, in, out, cOpts...)
188 if err != nil {
189 return nil, err
190 }
191 return out, nil
192 }
193
194 func (c *distributedSyncServiceClient) NotifyNewEvent(ctx context.Context, in *NewEventNotification, opts ...grpc.CallOption) (*v1.Empty, error) {
195 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
196 out := new(v1.Empty)
197 err := c.cc.Invoke(ctx, DistributedSyncService_NotifyNewEvent_FullMethodName, in, out, cOpts...)
198 if err != nil {
199 return nil, err
200 }
201 return out, nil
202 }
203
204 func (c *distributedSyncServiceClient) TriggerSync(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
205 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
206 out := new(v1.Empty)
207 err := c.cc.Invoke(ctx, DistributedSyncService_TriggerSync_FullMethodName, in, out, cOpts...)
208 if err != nil {
209 return nil, err
210 }
211 return out, nil
212 }
213
214 func (c *distributedSyncServiceClient) GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error) {
215 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
216 out := new(SyncStatusResponse)
217 err := c.cc.Invoke(ctx, DistributedSyncService_GetSyncStatus_FullMethodName, in, out, cOpts...)
218 if err != nil {
219 return nil, err
220 }
221 return out, nil
222 }
223
224 // DistributedSyncServiceServer is the server API for DistributedSyncService service.
225 // All implementations must embed UnimplementedDistributedSyncServiceServer
226 // for forward compatibility.
227 //
228 // DistributedSyncService provides serial-based peer-to-peer synchronization
229 // between relay instances using HTTP polling
230 type DistributedSyncServiceServer interface {
231 // Ready returns whether the service is ready to serve requests
232 Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error)
233 // GetInfo returns current sync service information
234 GetInfo(context.Context, *v1.Empty) (*v1.SyncInfo, error)
235 // GetCurrentSerial returns this relay's current serial number
236 GetCurrentSerial(context.Context, *CurrentRequest) (*CurrentResponse, error)
237 // GetEventIDs returns event IDs for a serial range
238 GetEventIDs(context.Context, *EventIDsRequest) (*EventIDsResponse, error)
239 // HandleCurrentRequest proxies /api/sync/current HTTP requests
240 HandleCurrentRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error)
241 // HandleEventIDsRequest proxies /api/sync/event-ids HTTP requests
242 HandleEventIDsRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error)
243 // GetPeers returns the current list of sync peers
244 GetPeers(context.Context, *v1.Empty) (*PeersResponse, error)
245 // UpdatePeers updates the peer list
246 UpdatePeers(context.Context, *UpdatePeersRequest) (*v1.Empty, error)
247 // IsAuthorizedPeer checks if a peer is authorized by validating its NIP-11 pubkey
248 IsAuthorizedPeer(context.Context, *AuthorizedPeerRequest) (*AuthorizedPeerResponse, error)
249 // GetPeerPubkey fetches the pubkey for a peer relay via NIP-11
250 GetPeerPubkey(context.Context, *PeerPubkeyRequest) (*PeerPubkeyResponse, error)
251 // UpdateSerial updates the current serial from database
252 UpdateSerial(context.Context, *v1.Empty) (*v1.Empty, error)
253 // NotifyNewEvent notifies the service of a new event being stored
254 NotifyNewEvent(context.Context, *NewEventNotification) (*v1.Empty, error)
255 // TriggerSync manually triggers a sync cycle with all peers
256 TriggerSync(context.Context, *v1.Empty) (*v1.Empty, error)
257 // GetSyncStatus returns current sync status for all peers
258 GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error)
259 mustEmbedUnimplementedDistributedSyncServiceServer()
260 }
261
262 // UnimplementedDistributedSyncServiceServer must be embedded to have
263 // forward compatible implementations.
264 //
265 // NOTE: this should be embedded by value instead of pointer to avoid a nil
266 // pointer dereference when methods are called.
267 type UnimplementedDistributedSyncServiceServer struct{}
268
269 func (UnimplementedDistributedSyncServiceServer) Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) {
270 return nil, status.Error(codes.Unimplemented, "method Ready not implemented")
271 }
272 func (UnimplementedDistributedSyncServiceServer) GetInfo(context.Context, *v1.Empty) (*v1.SyncInfo, error) {
273 return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented")
274 }
275 func (UnimplementedDistributedSyncServiceServer) GetCurrentSerial(context.Context, *CurrentRequest) (*CurrentResponse, error) {
276 return nil, status.Error(codes.Unimplemented, "method GetCurrentSerial not implemented")
277 }
278 func (UnimplementedDistributedSyncServiceServer) GetEventIDs(context.Context, *EventIDsRequest) (*EventIDsResponse, error) {
279 return nil, status.Error(codes.Unimplemented, "method GetEventIDs not implemented")
280 }
281 func (UnimplementedDistributedSyncServiceServer) HandleCurrentRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error) {
282 return nil, status.Error(codes.Unimplemented, "method HandleCurrentRequest not implemented")
283 }
284 func (UnimplementedDistributedSyncServiceServer) HandleEventIDsRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error) {
285 return nil, status.Error(codes.Unimplemented, "method HandleEventIDsRequest not implemented")
286 }
287 func (UnimplementedDistributedSyncServiceServer) GetPeers(context.Context, *v1.Empty) (*PeersResponse, error) {
288 return nil, status.Error(codes.Unimplemented, "method GetPeers not implemented")
289 }
290 func (UnimplementedDistributedSyncServiceServer) UpdatePeers(context.Context, *UpdatePeersRequest) (*v1.Empty, error) {
291 return nil, status.Error(codes.Unimplemented, "method UpdatePeers not implemented")
292 }
293 func (UnimplementedDistributedSyncServiceServer) IsAuthorizedPeer(context.Context, *AuthorizedPeerRequest) (*AuthorizedPeerResponse, error) {
294 return nil, status.Error(codes.Unimplemented, "method IsAuthorizedPeer not implemented")
295 }
296 func (UnimplementedDistributedSyncServiceServer) GetPeerPubkey(context.Context, *PeerPubkeyRequest) (*PeerPubkeyResponse, error) {
297 return nil, status.Error(codes.Unimplemented, "method GetPeerPubkey not implemented")
298 }
299 func (UnimplementedDistributedSyncServiceServer) UpdateSerial(context.Context, *v1.Empty) (*v1.Empty, error) {
300 return nil, status.Error(codes.Unimplemented, "method UpdateSerial not implemented")
301 }
302 func (UnimplementedDistributedSyncServiceServer) NotifyNewEvent(context.Context, *NewEventNotification) (*v1.Empty, error) {
303 return nil, status.Error(codes.Unimplemented, "method NotifyNewEvent not implemented")
304 }
305 func (UnimplementedDistributedSyncServiceServer) TriggerSync(context.Context, *v1.Empty) (*v1.Empty, error) {
306 return nil, status.Error(codes.Unimplemented, "method TriggerSync not implemented")
307 }
308 func (UnimplementedDistributedSyncServiceServer) GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error) {
309 return nil, status.Error(codes.Unimplemented, "method GetSyncStatus not implemented")
310 }
311 func (UnimplementedDistributedSyncServiceServer) mustEmbedUnimplementedDistributedSyncServiceServer() {
312 }
313 func (UnimplementedDistributedSyncServiceServer) testEmbeddedByValue() {}
314
315 // UnsafeDistributedSyncServiceServer may be embedded to opt out of forward compatibility for this service.
316 // Use of this interface is not recommended, as added methods to DistributedSyncServiceServer will
317 // result in compilation errors.
318 type UnsafeDistributedSyncServiceServer interface {
319 mustEmbedUnimplementedDistributedSyncServiceServer()
320 }
321
322 func RegisterDistributedSyncServiceServer(s grpc.ServiceRegistrar, srv DistributedSyncServiceServer) {
323 // If the following call panics, it indicates UnimplementedDistributedSyncServiceServer was
324 // embedded by pointer and is nil. This will cause panics if an
325 // unimplemented method is ever invoked, so we test this at initialization
326 // time to prevent it from happening at runtime later due to I/O.
327 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
328 t.testEmbeddedByValue()
329 }
330 s.RegisterService(&DistributedSyncService_ServiceDesc, srv)
331 }
332
333 func _DistributedSyncService_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
334 in := new(v1.Empty)
335 if err := dec(in); err != nil {
336 return nil, err
337 }
338 if interceptor == nil {
339 return srv.(DistributedSyncServiceServer).Ready(ctx, in)
340 }
341 info := &grpc.UnaryServerInfo{
342 Server: srv,
343 FullMethod: DistributedSyncService_Ready_FullMethodName,
344 }
345 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
346 return srv.(DistributedSyncServiceServer).Ready(ctx, req.(*v1.Empty))
347 }
348 return interceptor(ctx, in, info, handler)
349 }
350
351 func _DistributedSyncService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
352 in := new(v1.Empty)
353 if err := dec(in); err != nil {
354 return nil, err
355 }
356 if interceptor == nil {
357 return srv.(DistributedSyncServiceServer).GetInfo(ctx, in)
358 }
359 info := &grpc.UnaryServerInfo{
360 Server: srv,
361 FullMethod: DistributedSyncService_GetInfo_FullMethodName,
362 }
363 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
364 return srv.(DistributedSyncServiceServer).GetInfo(ctx, req.(*v1.Empty))
365 }
366 return interceptor(ctx, in, info, handler)
367 }
368
369 func _DistributedSyncService_GetCurrentSerial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
370 in := new(CurrentRequest)
371 if err := dec(in); err != nil {
372 return nil, err
373 }
374 if interceptor == nil {
375 return srv.(DistributedSyncServiceServer).GetCurrentSerial(ctx, in)
376 }
377 info := &grpc.UnaryServerInfo{
378 Server: srv,
379 FullMethod: DistributedSyncService_GetCurrentSerial_FullMethodName,
380 }
381 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
382 return srv.(DistributedSyncServiceServer).GetCurrentSerial(ctx, req.(*CurrentRequest))
383 }
384 return interceptor(ctx, in, info, handler)
385 }
386
387 func _DistributedSyncService_GetEventIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
388 in := new(EventIDsRequest)
389 if err := dec(in); err != nil {
390 return nil, err
391 }
392 if interceptor == nil {
393 return srv.(DistributedSyncServiceServer).GetEventIDs(ctx, in)
394 }
395 info := &grpc.UnaryServerInfo{
396 Server: srv,
397 FullMethod: DistributedSyncService_GetEventIDs_FullMethodName,
398 }
399 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
400 return srv.(DistributedSyncServiceServer).GetEventIDs(ctx, req.(*EventIDsRequest))
401 }
402 return interceptor(ctx, in, info, handler)
403 }
404
405 func _DistributedSyncService_HandleCurrentRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
406 in := new(v1.HTTPRequest)
407 if err := dec(in); err != nil {
408 return nil, err
409 }
410 if interceptor == nil {
411 return srv.(DistributedSyncServiceServer).HandleCurrentRequest(ctx, in)
412 }
413 info := &grpc.UnaryServerInfo{
414 Server: srv,
415 FullMethod: DistributedSyncService_HandleCurrentRequest_FullMethodName,
416 }
417 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
418 return srv.(DistributedSyncServiceServer).HandleCurrentRequest(ctx, req.(*v1.HTTPRequest))
419 }
420 return interceptor(ctx, in, info, handler)
421 }
422
423 func _DistributedSyncService_HandleEventIDsRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
424 in := new(v1.HTTPRequest)
425 if err := dec(in); err != nil {
426 return nil, err
427 }
428 if interceptor == nil {
429 return srv.(DistributedSyncServiceServer).HandleEventIDsRequest(ctx, in)
430 }
431 info := &grpc.UnaryServerInfo{
432 Server: srv,
433 FullMethod: DistributedSyncService_HandleEventIDsRequest_FullMethodName,
434 }
435 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
436 return srv.(DistributedSyncServiceServer).HandleEventIDsRequest(ctx, req.(*v1.HTTPRequest))
437 }
438 return interceptor(ctx, in, info, handler)
439 }
440
441 func _DistributedSyncService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
442 in := new(v1.Empty)
443 if err := dec(in); err != nil {
444 return nil, err
445 }
446 if interceptor == nil {
447 return srv.(DistributedSyncServiceServer).GetPeers(ctx, in)
448 }
449 info := &grpc.UnaryServerInfo{
450 Server: srv,
451 FullMethod: DistributedSyncService_GetPeers_FullMethodName,
452 }
453 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
454 return srv.(DistributedSyncServiceServer).GetPeers(ctx, req.(*v1.Empty))
455 }
456 return interceptor(ctx, in, info, handler)
457 }
458
459 func _DistributedSyncService_UpdatePeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
460 in := new(UpdatePeersRequest)
461 if err := dec(in); err != nil {
462 return nil, err
463 }
464 if interceptor == nil {
465 return srv.(DistributedSyncServiceServer).UpdatePeers(ctx, in)
466 }
467 info := &grpc.UnaryServerInfo{
468 Server: srv,
469 FullMethod: DistributedSyncService_UpdatePeers_FullMethodName,
470 }
471 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
472 return srv.(DistributedSyncServiceServer).UpdatePeers(ctx, req.(*UpdatePeersRequest))
473 }
474 return interceptor(ctx, in, info, handler)
475 }
476
477 func _DistributedSyncService_IsAuthorizedPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
478 in := new(AuthorizedPeerRequest)
479 if err := dec(in); err != nil {
480 return nil, err
481 }
482 if interceptor == nil {
483 return srv.(DistributedSyncServiceServer).IsAuthorizedPeer(ctx, in)
484 }
485 info := &grpc.UnaryServerInfo{
486 Server: srv,
487 FullMethod: DistributedSyncService_IsAuthorizedPeer_FullMethodName,
488 }
489 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
490 return srv.(DistributedSyncServiceServer).IsAuthorizedPeer(ctx, req.(*AuthorizedPeerRequest))
491 }
492 return interceptor(ctx, in, info, handler)
493 }
494
495 func _DistributedSyncService_GetPeerPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
496 in := new(PeerPubkeyRequest)
497 if err := dec(in); err != nil {
498 return nil, err
499 }
500 if interceptor == nil {
501 return srv.(DistributedSyncServiceServer).GetPeerPubkey(ctx, in)
502 }
503 info := &grpc.UnaryServerInfo{
504 Server: srv,
505 FullMethod: DistributedSyncService_GetPeerPubkey_FullMethodName,
506 }
507 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
508 return srv.(DistributedSyncServiceServer).GetPeerPubkey(ctx, req.(*PeerPubkeyRequest))
509 }
510 return interceptor(ctx, in, info, handler)
511 }
512
513 func _DistributedSyncService_UpdateSerial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
514 in := new(v1.Empty)
515 if err := dec(in); err != nil {
516 return nil, err
517 }
518 if interceptor == nil {
519 return srv.(DistributedSyncServiceServer).UpdateSerial(ctx, in)
520 }
521 info := &grpc.UnaryServerInfo{
522 Server: srv,
523 FullMethod: DistributedSyncService_UpdateSerial_FullMethodName,
524 }
525 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
526 return srv.(DistributedSyncServiceServer).UpdateSerial(ctx, req.(*v1.Empty))
527 }
528 return interceptor(ctx, in, info, handler)
529 }
530
531 func _DistributedSyncService_NotifyNewEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
532 in := new(NewEventNotification)
533 if err := dec(in); err != nil {
534 return nil, err
535 }
536 if interceptor == nil {
537 return srv.(DistributedSyncServiceServer).NotifyNewEvent(ctx, in)
538 }
539 info := &grpc.UnaryServerInfo{
540 Server: srv,
541 FullMethod: DistributedSyncService_NotifyNewEvent_FullMethodName,
542 }
543 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
544 return srv.(DistributedSyncServiceServer).NotifyNewEvent(ctx, req.(*NewEventNotification))
545 }
546 return interceptor(ctx, in, info, handler)
547 }
548
549 func _DistributedSyncService_TriggerSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
550 in := new(v1.Empty)
551 if err := dec(in); err != nil {
552 return nil, err
553 }
554 if interceptor == nil {
555 return srv.(DistributedSyncServiceServer).TriggerSync(ctx, in)
556 }
557 info := &grpc.UnaryServerInfo{
558 Server: srv,
559 FullMethod: DistributedSyncService_TriggerSync_FullMethodName,
560 }
561 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
562 return srv.(DistributedSyncServiceServer).TriggerSync(ctx, req.(*v1.Empty))
563 }
564 return interceptor(ctx, in, info, handler)
565 }
566
567 func _DistributedSyncService_GetSyncStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
568 in := new(v1.Empty)
569 if err := dec(in); err != nil {
570 return nil, err
571 }
572 if interceptor == nil {
573 return srv.(DistributedSyncServiceServer).GetSyncStatus(ctx, in)
574 }
575 info := &grpc.UnaryServerInfo{
576 Server: srv,
577 FullMethod: DistributedSyncService_GetSyncStatus_FullMethodName,
578 }
579 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
580 return srv.(DistributedSyncServiceServer).GetSyncStatus(ctx, req.(*v1.Empty))
581 }
582 return interceptor(ctx, in, info, handler)
583 }
584
585 // DistributedSyncService_ServiceDesc is the grpc.ServiceDesc for DistributedSyncService service.
586 // It's only intended for direct use with grpc.RegisterService,
587 // and not to be introspected or modified (even as a copy)
588 var DistributedSyncService_ServiceDesc = grpc.ServiceDesc{
589 ServiceName: "orlysync.distributed.v1.DistributedSyncService",
590 HandlerType: (*DistributedSyncServiceServer)(nil),
591 Methods: []grpc.MethodDesc{
592 {
593 MethodName: "Ready",
594 Handler: _DistributedSyncService_Ready_Handler,
595 },
596 {
597 MethodName: "GetInfo",
598 Handler: _DistributedSyncService_GetInfo_Handler,
599 },
600 {
601 MethodName: "GetCurrentSerial",
602 Handler: _DistributedSyncService_GetCurrentSerial_Handler,
603 },
604 {
605 MethodName: "GetEventIDs",
606 Handler: _DistributedSyncService_GetEventIDs_Handler,
607 },
608 {
609 MethodName: "HandleCurrentRequest",
610 Handler: _DistributedSyncService_HandleCurrentRequest_Handler,
611 },
612 {
613 MethodName: "HandleEventIDsRequest",
614 Handler: _DistributedSyncService_HandleEventIDsRequest_Handler,
615 },
616 {
617 MethodName: "GetPeers",
618 Handler: _DistributedSyncService_GetPeers_Handler,
619 },
620 {
621 MethodName: "UpdatePeers",
622 Handler: _DistributedSyncService_UpdatePeers_Handler,
623 },
624 {
625 MethodName: "IsAuthorizedPeer",
626 Handler: _DistributedSyncService_IsAuthorizedPeer_Handler,
627 },
628 {
629 MethodName: "GetPeerPubkey",
630 Handler: _DistributedSyncService_GetPeerPubkey_Handler,
631 },
632 {
633 MethodName: "UpdateSerial",
634 Handler: _DistributedSyncService_UpdateSerial_Handler,
635 },
636 {
637 MethodName: "NotifyNewEvent",
638 Handler: _DistributedSyncService_NotifyNewEvent_Handler,
639 },
640 {
641 MethodName: "TriggerSync",
642 Handler: _DistributedSyncService_TriggerSync_Handler,
643 },
644 {
645 MethodName: "GetSyncStatus",
646 Handler: _DistributedSyncService_GetSyncStatus_Handler,
647 },
648 },
649 Streams: []grpc.StreamDesc{},
650 Metadata: "orlysync/distributed/v1/service.proto",
651 }
652