You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

651 lines
28 KiB

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc (unknown)
// source: orlysync/distributed/v1/service.proto
package distributedv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
v1 "next.orly.dev/pkg/proto/orlysync/common/v1"
)
// 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 (
DistributedSyncService_Ready_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/Ready"
DistributedSyncService_GetInfo_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetInfo"
DistributedSyncService_GetCurrentSerial_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetCurrentSerial"
DistributedSyncService_GetEventIDs_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetEventIDs"
DistributedSyncService_HandleCurrentRequest_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/HandleCurrentRequest"
DistributedSyncService_HandleEventIDsRequest_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/HandleEventIDsRequest"
DistributedSyncService_GetPeers_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetPeers"
DistributedSyncService_UpdatePeers_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/UpdatePeers"
DistributedSyncService_IsAuthorizedPeer_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/IsAuthorizedPeer"
DistributedSyncService_GetPeerPubkey_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetPeerPubkey"
DistributedSyncService_UpdateSerial_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/UpdateSerial"
DistributedSyncService_NotifyNewEvent_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/NotifyNewEvent"
DistributedSyncService_TriggerSync_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/TriggerSync"
DistributedSyncService_GetSyncStatus_FullMethodName = "/orlysync.distributed.v1.DistributedSyncService/GetSyncStatus"
)
// DistributedSyncServiceClient is the client API for DistributedSyncService 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.
//
// DistributedSyncService provides serial-based peer-to-peer synchronization
// between relay instances using HTTP polling
type DistributedSyncServiceClient interface {
// Ready returns whether the service is ready to serve requests
Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error)
// GetInfo returns current sync service information
GetInfo(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.SyncInfo, error)
// GetCurrentSerial returns this relay's current serial number
GetCurrentSerial(ctx context.Context, in *CurrentRequest, opts ...grpc.CallOption) (*CurrentResponse, error)
// GetEventIDs returns event IDs for a serial range
GetEventIDs(ctx context.Context, in *EventIDsRequest, opts ...grpc.CallOption) (*EventIDsResponse, error)
// HandleCurrentRequest proxies /api/sync/current HTTP requests
HandleCurrentRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error)
// HandleEventIDsRequest proxies /api/sync/event-ids HTTP requests
HandleEventIDsRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error)
// GetPeers returns the current list of sync peers
GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error)
// UpdatePeers updates the peer list
UpdatePeers(ctx context.Context, in *UpdatePeersRequest, opts ...grpc.CallOption) (*v1.Empty, error)
// IsAuthorizedPeer checks if a peer is authorized by validating its NIP-11 pubkey
IsAuthorizedPeer(ctx context.Context, in *AuthorizedPeerRequest, opts ...grpc.CallOption) (*AuthorizedPeerResponse, error)
// GetPeerPubkey fetches the pubkey for a peer relay via NIP-11
GetPeerPubkey(ctx context.Context, in *PeerPubkeyRequest, opts ...grpc.CallOption) (*PeerPubkeyResponse, error)
// UpdateSerial updates the current serial from database
UpdateSerial(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
// NotifyNewEvent notifies the service of a new event being stored
NotifyNewEvent(ctx context.Context, in *NewEventNotification, opts ...grpc.CallOption) (*v1.Empty, error)
// TriggerSync manually triggers a sync cycle with all peers
TriggerSync(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
// GetSyncStatus returns current sync status for all peers
GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error)
}
type distributedSyncServiceClient struct {
cc grpc.ClientConnInterface
}
func NewDistributedSyncServiceClient(cc grpc.ClientConnInterface) DistributedSyncServiceClient {
return &distributedSyncServiceClient{cc}
}
func (c *distributedSyncServiceClient) Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.ReadyResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_Ready_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetInfo(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.SyncInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.SyncInfo)
err := c.cc.Invoke(ctx, DistributedSyncService_GetInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetCurrentSerial(ctx context.Context, in *CurrentRequest, opts ...grpc.CallOption) (*CurrentResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CurrentResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_GetCurrentSerial_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetEventIDs(ctx context.Context, in *EventIDsRequest, opts ...grpc.CallOption) (*EventIDsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EventIDsResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_GetEventIDs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) HandleCurrentRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.HTTPResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_HandleCurrentRequest_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) HandleEventIDsRequest(ctx context.Context, in *v1.HTTPRequest, opts ...grpc.CallOption) (*v1.HTTPResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.HTTPResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_HandleEventIDsRequest_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PeersResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_GetPeers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) UpdatePeers(ctx context.Context, in *UpdatePeersRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.Empty)
err := c.cc.Invoke(ctx, DistributedSyncService_UpdatePeers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) IsAuthorizedPeer(ctx context.Context, in *AuthorizedPeerRequest, opts ...grpc.CallOption) (*AuthorizedPeerResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthorizedPeerResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_IsAuthorizedPeer_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetPeerPubkey(ctx context.Context, in *PeerPubkeyRequest, opts ...grpc.CallOption) (*PeerPubkeyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PeerPubkeyResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_GetPeerPubkey_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) UpdateSerial(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.Empty)
err := c.cc.Invoke(ctx, DistributedSyncService_UpdateSerial_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) NotifyNewEvent(ctx context.Context, in *NewEventNotification, opts ...grpc.CallOption) (*v1.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.Empty)
err := c.cc.Invoke(ctx, DistributedSyncService_NotifyNewEvent_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) TriggerSync(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.Empty)
err := c.cc.Invoke(ctx, DistributedSyncService_TriggerSync_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *distributedSyncServiceClient) GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SyncStatusResponse)
err := c.cc.Invoke(ctx, DistributedSyncService_GetSyncStatus_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// DistributedSyncServiceServer is the server API for DistributedSyncService service.
// All implementations must embed UnimplementedDistributedSyncServiceServer
// for forward compatibility.
//
// DistributedSyncService provides serial-based peer-to-peer synchronization
// between relay instances using HTTP polling
type DistributedSyncServiceServer interface {
// Ready returns whether the service is ready to serve requests
Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error)
// GetInfo returns current sync service information
GetInfo(context.Context, *v1.Empty) (*v1.SyncInfo, error)
// GetCurrentSerial returns this relay's current serial number
GetCurrentSerial(context.Context, *CurrentRequest) (*CurrentResponse, error)
// GetEventIDs returns event IDs for a serial range
GetEventIDs(context.Context, *EventIDsRequest) (*EventIDsResponse, error)
// HandleCurrentRequest proxies /api/sync/current HTTP requests
HandleCurrentRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error)
// HandleEventIDsRequest proxies /api/sync/event-ids HTTP requests
HandleEventIDsRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error)
// GetPeers returns the current list of sync peers
GetPeers(context.Context, *v1.Empty) (*PeersResponse, error)
// UpdatePeers updates the peer list
UpdatePeers(context.Context, *UpdatePeersRequest) (*v1.Empty, error)
// IsAuthorizedPeer checks if a peer is authorized by validating its NIP-11 pubkey
IsAuthorizedPeer(context.Context, *AuthorizedPeerRequest) (*AuthorizedPeerResponse, error)
// GetPeerPubkey fetches the pubkey for a peer relay via NIP-11
GetPeerPubkey(context.Context, *PeerPubkeyRequest) (*PeerPubkeyResponse, error)
// UpdateSerial updates the current serial from database
UpdateSerial(context.Context, *v1.Empty) (*v1.Empty, error)
// NotifyNewEvent notifies the service of a new event being stored
NotifyNewEvent(context.Context, *NewEventNotification) (*v1.Empty, error)
// TriggerSync manually triggers a sync cycle with all peers
TriggerSync(context.Context, *v1.Empty) (*v1.Empty, error)
// GetSyncStatus returns current sync status for all peers
GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error)
mustEmbedUnimplementedDistributedSyncServiceServer()
}
// UnimplementedDistributedSyncServiceServer 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 UnimplementedDistributedSyncServiceServer struct{}
func (UnimplementedDistributedSyncServiceServer) Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Ready not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetInfo(context.Context, *v1.Empty) (*v1.SyncInfo, error) {
return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetCurrentSerial(context.Context, *CurrentRequest) (*CurrentResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetCurrentSerial not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetEventIDs(context.Context, *EventIDsRequest) (*EventIDsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetEventIDs not implemented")
}
func (UnimplementedDistributedSyncServiceServer) HandleCurrentRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error) {
return nil, status.Error(codes.Unimplemented, "method HandleCurrentRequest not implemented")
}
func (UnimplementedDistributedSyncServiceServer) HandleEventIDsRequest(context.Context, *v1.HTTPRequest) (*v1.HTTPResponse, error) {
return nil, status.Error(codes.Unimplemented, "method HandleEventIDsRequest not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetPeers(context.Context, *v1.Empty) (*PeersResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetPeers not implemented")
}
func (UnimplementedDistributedSyncServiceServer) UpdatePeers(context.Context, *UpdatePeersRequest) (*v1.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method UpdatePeers not implemented")
}
func (UnimplementedDistributedSyncServiceServer) IsAuthorizedPeer(context.Context, *AuthorizedPeerRequest) (*AuthorizedPeerResponse, error) {
return nil, status.Error(codes.Unimplemented, "method IsAuthorizedPeer not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetPeerPubkey(context.Context, *PeerPubkeyRequest) (*PeerPubkeyResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetPeerPubkey not implemented")
}
func (UnimplementedDistributedSyncServiceServer) UpdateSerial(context.Context, *v1.Empty) (*v1.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateSerial not implemented")
}
func (UnimplementedDistributedSyncServiceServer) NotifyNewEvent(context.Context, *NewEventNotification) (*v1.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method NotifyNewEvent not implemented")
}
func (UnimplementedDistributedSyncServiceServer) TriggerSync(context.Context, *v1.Empty) (*v1.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method TriggerSync not implemented")
}
func (UnimplementedDistributedSyncServiceServer) GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetSyncStatus not implemented")
}
func (UnimplementedDistributedSyncServiceServer) mustEmbedUnimplementedDistributedSyncServiceServer() {
}
func (UnimplementedDistributedSyncServiceServer) testEmbeddedByValue() {}
// UnsafeDistributedSyncServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DistributedSyncServiceServer will
// result in compilation errors.
type UnsafeDistributedSyncServiceServer interface {
mustEmbedUnimplementedDistributedSyncServiceServer()
}
func RegisterDistributedSyncServiceServer(s grpc.ServiceRegistrar, srv DistributedSyncServiceServer) {
// If the following call panics, it indicates UnimplementedDistributedSyncServiceServer 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(&DistributedSyncService_ServiceDesc, srv)
}
func _DistributedSyncService_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).Ready(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_Ready_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).Ready(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetInfo(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetCurrentSerial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CurrentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetCurrentSerial(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetCurrentSerial_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetCurrentSerial(ctx, req.(*CurrentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetEventIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EventIDsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetEventIDs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetEventIDs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetEventIDs(ctx, req.(*EventIDsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_HandleCurrentRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.HTTPRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).HandleCurrentRequest(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_HandleCurrentRequest_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).HandleCurrentRequest(ctx, req.(*v1.HTTPRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_HandleEventIDsRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.HTTPRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).HandleEventIDsRequest(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_HandleEventIDsRequest_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).HandleEventIDsRequest(ctx, req.(*v1.HTTPRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetPeers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetPeers(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_UpdatePeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).UpdatePeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_UpdatePeers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).UpdatePeers(ctx, req.(*UpdatePeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_IsAuthorizedPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthorizedPeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).IsAuthorizedPeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_IsAuthorizedPeer_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).IsAuthorizedPeer(ctx, req.(*AuthorizedPeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetPeerPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PeerPubkeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetPeerPubkey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetPeerPubkey_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetPeerPubkey(ctx, req.(*PeerPubkeyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_UpdateSerial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).UpdateSerial(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_UpdateSerial_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).UpdateSerial(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_NotifyNewEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NewEventNotification)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).NotifyNewEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_NotifyNewEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).NotifyNewEvent(ctx, req.(*NewEventNotification))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_TriggerSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).TriggerSync(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_TriggerSync_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).TriggerSync(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DistributedSyncService_GetSyncStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DistributedSyncServiceServer).GetSyncStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DistributedSyncService_GetSyncStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DistributedSyncServiceServer).GetSyncStatus(ctx, req.(*v1.Empty))
}
return interceptor(ctx, in, info, handler)
}
// DistributedSyncService_ServiceDesc is the grpc.ServiceDesc for DistributedSyncService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DistributedSyncService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "orlysync.distributed.v1.DistributedSyncService",
HandlerType: (*DistributedSyncServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Ready",
Handler: _DistributedSyncService_Ready_Handler,
},
{
MethodName: "GetInfo",
Handler: _DistributedSyncService_GetInfo_Handler,
},
{
MethodName: "GetCurrentSerial",
Handler: _DistributedSyncService_GetCurrentSerial_Handler,
},
{
MethodName: "GetEventIDs",
Handler: _DistributedSyncService_GetEventIDs_Handler,
},
{
MethodName: "HandleCurrentRequest",
Handler: _DistributedSyncService_HandleCurrentRequest_Handler,
},
{
MethodName: "HandleEventIDsRequest",
Handler: _DistributedSyncService_HandleEventIDsRequest_Handler,
},
{
MethodName: "GetPeers",
Handler: _DistributedSyncService_GetPeers_Handler,
},
{
MethodName: "UpdatePeers",
Handler: _DistributedSyncService_UpdatePeers_Handler,
},
{
MethodName: "IsAuthorizedPeer",
Handler: _DistributedSyncService_IsAuthorizedPeer_Handler,
},
{
MethodName: "GetPeerPubkey",
Handler: _DistributedSyncService_GetPeerPubkey_Handler,
},
{
MethodName: "UpdateSerial",
Handler: _DistributedSyncService_UpdateSerial_Handler,
},
{
MethodName: "NotifyNewEvent",
Handler: _DistributedSyncService_NotifyNewEvent_Handler,
},
{
MethodName: "TriggerSync",
Handler: _DistributedSyncService_TriggerSync_Handler,
},
{
MethodName: "GetSyncStatus",
Handler: _DistributedSyncService_GetSyncStatus_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "orlysync/distributed/v1/service.proto",
}