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.
694 lines
29 KiB
694 lines
29 KiB
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
|
// versions: |
|
// - protoc-gen-go-grpc v1.6.0 |
|
// - protoc (unknown) |
|
// source: orlysync/negentropy/v1/service.proto |
|
|
|
package negentropyv1 |
|
|
|
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 ( |
|
NegentropyService_Ready_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Ready" |
|
NegentropyService_Start_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Start" |
|
NegentropyService_Stop_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/Stop" |
|
NegentropyService_HandleNegOpen_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegOpen" |
|
NegentropyService_HandleNegMsg_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegMsg" |
|
NegentropyService_HandleNegClose_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/HandleNegClose" |
|
NegentropyService_SyncWithPeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/SyncWithPeer" |
|
NegentropyService_GetSyncStatus_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetSyncStatus" |
|
NegentropyService_GetPeers_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetPeers" |
|
NegentropyService_AddPeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/AddPeer" |
|
NegentropyService_RemovePeer_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/RemovePeer" |
|
NegentropyService_TriggerSync_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/TriggerSync" |
|
NegentropyService_GetPeerSyncState_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/GetPeerSyncState" |
|
NegentropyService_ListSessions_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/ListSessions" |
|
NegentropyService_CloseSession_FullMethodName = "/orlysync.negentropy.v1.NegentropyService/CloseSession" |
|
) |
|
|
|
// NegentropyServiceClient is the client API for NegentropyService 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. |
|
// |
|
// NegentropyService provides NIP-77 negentropy-based set reconciliation |
|
// for both relay-to-relay sync and client-facing WebSocket operations |
|
type NegentropyServiceClient interface { |
|
// Ready returns whether the service is ready to serve requests |
|
Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error) |
|
// Start starts the background relay-to-relay sync |
|
Start(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// Stop stops the background sync |
|
Stop(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// HandleNegOpen processes a NEG-OPEN message from a client |
|
HandleNegOpen(ctx context.Context, in *NegOpenRequest, opts ...grpc.CallOption) (*NegOpenResponse, error) |
|
// HandleNegMsg processes a NEG-MSG message from a client |
|
HandleNegMsg(ctx context.Context, in *NegMsgRequest, opts ...grpc.CallOption) (*NegMsgResponse, error) |
|
// HandleNegClose processes a NEG-CLOSE message from a client |
|
HandleNegClose(ctx context.Context, in *NegCloseRequest, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// SyncWithPeer initiates negentropy sync with a specific peer relay |
|
SyncWithPeer(ctx context.Context, in *SyncPeerRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncProgress], error) |
|
// GetSyncStatus returns the current sync status |
|
GetSyncStatus(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*SyncStatusResponse, error) |
|
// GetPeers returns the list of negentropy sync peers |
|
GetPeers(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*PeersResponse, error) |
|
// AddPeer adds a peer for negentropy sync |
|
AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// RemovePeer removes a peer from negentropy sync |
|
RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// TriggerSync manually triggers sync with a specific peer or all peers |
|
TriggerSync(ctx context.Context, in *TriggerSyncRequest, opts ...grpc.CallOption) (*v1.Empty, error) |
|
// GetPeerSyncState returns sync state for a specific peer |
|
GetPeerSyncState(ctx context.Context, in *PeerSyncStateRequest, opts ...grpc.CallOption) (*PeerSyncStateResponse, error) |
|
// ListSessions returns active client negentropy sessions |
|
ListSessions(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*ListSessionsResponse, error) |
|
// CloseSession forcefully closes a client session |
|
CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*v1.Empty, error) |
|
} |
|
|
|
type negentropyServiceClient struct { |
|
cc grpc.ClientConnInterface |
|
} |
|
|
|
func NewNegentropyServiceClient(cc grpc.ClientConnInterface) NegentropyServiceClient { |
|
return &negentropyServiceClient{cc} |
|
} |
|
|
|
func (c *negentropyServiceClient) 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, NegentropyService_Ready_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) Start(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, NegentropyService_Start_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) Stop(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, NegentropyService_Stop_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) HandleNegOpen(ctx context.Context, in *NegOpenRequest, opts ...grpc.CallOption) (*NegOpenResponse, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(NegOpenResponse) |
|
err := c.cc.Invoke(ctx, NegentropyService_HandleNegOpen_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) HandleNegMsg(ctx context.Context, in *NegMsgRequest, opts ...grpc.CallOption) (*NegMsgResponse, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(NegMsgResponse) |
|
err := c.cc.Invoke(ctx, NegentropyService_HandleNegMsg_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) HandleNegClose(ctx context.Context, in *NegCloseRequest, opts ...grpc.CallOption) (*v1.Empty, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(v1.Empty) |
|
err := c.cc.Invoke(ctx, NegentropyService_HandleNegClose_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) SyncWithPeer(ctx context.Context, in *SyncPeerRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncProgress], error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
stream, err := c.cc.NewStream(ctx, &NegentropyService_ServiceDesc.Streams[0], NegentropyService_SyncWithPeer_FullMethodName, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
x := &grpc.GenericClientStream[SyncPeerRequest, SyncProgress]{ClientStream: stream} |
|
if err := x.ClientStream.SendMsg(in); err != nil { |
|
return nil, err |
|
} |
|
if err := x.ClientStream.CloseSend(); err != nil { |
|
return nil, err |
|
} |
|
return x, nil |
|
} |
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
|
type NegentropyService_SyncWithPeerClient = grpc.ServerStreamingClient[SyncProgress] |
|
|
|
func (c *negentropyServiceClient) 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, NegentropyService_GetSyncStatus_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) 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, NegentropyService_GetPeers_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(v1.Empty) |
|
err := c.cc.Invoke(ctx, NegentropyService_AddPeer_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*v1.Empty, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(v1.Empty) |
|
err := c.cc.Invoke(ctx, NegentropyService_RemovePeer_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) TriggerSync(ctx context.Context, in *TriggerSyncRequest, opts ...grpc.CallOption) (*v1.Empty, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(v1.Empty) |
|
err := c.cc.Invoke(ctx, NegentropyService_TriggerSync_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) GetPeerSyncState(ctx context.Context, in *PeerSyncStateRequest, opts ...grpc.CallOption) (*PeerSyncStateResponse, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(PeerSyncStateResponse) |
|
err := c.cc.Invoke(ctx, NegentropyService_GetPeerSyncState_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) ListSessions(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*ListSessionsResponse, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(ListSessionsResponse) |
|
err := c.cc.Invoke(ctx, NegentropyService_ListSessions_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *negentropyServiceClient) CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*v1.Empty, error) { |
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|
out := new(v1.Empty) |
|
err := c.cc.Invoke(ctx, NegentropyService_CloseSession_FullMethodName, in, out, cOpts...) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
// NegentropyServiceServer is the server API for NegentropyService service. |
|
// All implementations must embed UnimplementedNegentropyServiceServer |
|
// for forward compatibility. |
|
// |
|
// NegentropyService provides NIP-77 negentropy-based set reconciliation |
|
// for both relay-to-relay sync and client-facing WebSocket operations |
|
type NegentropyServiceServer interface { |
|
// Ready returns whether the service is ready to serve requests |
|
Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) |
|
// Start starts the background relay-to-relay sync |
|
Start(context.Context, *v1.Empty) (*v1.Empty, error) |
|
// Stop stops the background sync |
|
Stop(context.Context, *v1.Empty) (*v1.Empty, error) |
|
// HandleNegOpen processes a NEG-OPEN message from a client |
|
HandleNegOpen(context.Context, *NegOpenRequest) (*NegOpenResponse, error) |
|
// HandleNegMsg processes a NEG-MSG message from a client |
|
HandleNegMsg(context.Context, *NegMsgRequest) (*NegMsgResponse, error) |
|
// HandleNegClose processes a NEG-CLOSE message from a client |
|
HandleNegClose(context.Context, *NegCloseRequest) (*v1.Empty, error) |
|
// SyncWithPeer initiates negentropy sync with a specific peer relay |
|
SyncWithPeer(*SyncPeerRequest, grpc.ServerStreamingServer[SyncProgress]) error |
|
// GetSyncStatus returns the current sync status |
|
GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error) |
|
// GetPeers returns the list of negentropy sync peers |
|
GetPeers(context.Context, *v1.Empty) (*PeersResponse, error) |
|
// AddPeer adds a peer for negentropy sync |
|
AddPeer(context.Context, *AddPeerRequest) (*v1.Empty, error) |
|
// RemovePeer removes a peer from negentropy sync |
|
RemovePeer(context.Context, *RemovePeerRequest) (*v1.Empty, error) |
|
// TriggerSync manually triggers sync with a specific peer or all peers |
|
TriggerSync(context.Context, *TriggerSyncRequest) (*v1.Empty, error) |
|
// GetPeerSyncState returns sync state for a specific peer |
|
GetPeerSyncState(context.Context, *PeerSyncStateRequest) (*PeerSyncStateResponse, error) |
|
// ListSessions returns active client negentropy sessions |
|
ListSessions(context.Context, *v1.Empty) (*ListSessionsResponse, error) |
|
// CloseSession forcefully closes a client session |
|
CloseSession(context.Context, *CloseSessionRequest) (*v1.Empty, error) |
|
mustEmbedUnimplementedNegentropyServiceServer() |
|
} |
|
|
|
// UnimplementedNegentropyServiceServer 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 UnimplementedNegentropyServiceServer struct{} |
|
|
|
func (UnimplementedNegentropyServiceServer) Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method Ready not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) Start(context.Context, *v1.Empty) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method Start not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) Stop(context.Context, *v1.Empty) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method Stop not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) HandleNegOpen(context.Context, *NegOpenRequest) (*NegOpenResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method HandleNegOpen not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) HandleNegMsg(context.Context, *NegMsgRequest) (*NegMsgResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method HandleNegMsg not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) HandleNegClose(context.Context, *NegCloseRequest) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method HandleNegClose not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) SyncWithPeer(*SyncPeerRequest, grpc.ServerStreamingServer[SyncProgress]) error { |
|
return status.Error(codes.Unimplemented, "method SyncWithPeer not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) GetSyncStatus(context.Context, *v1.Empty) (*SyncStatusResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method GetSyncStatus not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) GetPeers(context.Context, *v1.Empty) (*PeersResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method GetPeers not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) AddPeer(context.Context, *AddPeerRequest) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method AddPeer not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) RemovePeer(context.Context, *RemovePeerRequest) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method RemovePeer not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) TriggerSync(context.Context, *TriggerSyncRequest) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method TriggerSync not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) GetPeerSyncState(context.Context, *PeerSyncStateRequest) (*PeerSyncStateResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method GetPeerSyncState not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) ListSessions(context.Context, *v1.Empty) (*ListSessionsResponse, error) { |
|
return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) CloseSession(context.Context, *CloseSessionRequest) (*v1.Empty, error) { |
|
return nil, status.Error(codes.Unimplemented, "method CloseSession not implemented") |
|
} |
|
func (UnimplementedNegentropyServiceServer) mustEmbedUnimplementedNegentropyServiceServer() {} |
|
func (UnimplementedNegentropyServiceServer) testEmbeddedByValue() {} |
|
|
|
// UnsafeNegentropyServiceServer may be embedded to opt out of forward compatibility for this service. |
|
// Use of this interface is not recommended, as added methods to NegentropyServiceServer will |
|
// result in compilation errors. |
|
type UnsafeNegentropyServiceServer interface { |
|
mustEmbedUnimplementedNegentropyServiceServer() |
|
} |
|
|
|
func RegisterNegentropyServiceServer(s grpc.ServiceRegistrar, srv NegentropyServiceServer) { |
|
// If the following call panics, it indicates UnimplementedNegentropyServiceServer 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(&NegentropyService_ServiceDesc, srv) |
|
} |
|
|
|
func _NegentropyService_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.(NegentropyServiceServer).Ready(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_Ready_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).Ready(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_Start_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.(NegentropyServiceServer).Start(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_Start_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).Start(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_Stop_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.(NegentropyServiceServer).Stop(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_Stop_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).Stop(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_HandleNegOpen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(NegOpenRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).HandleNegOpen(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_HandleNegOpen_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).HandleNegOpen(ctx, req.(*NegOpenRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_HandleNegMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(NegMsgRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).HandleNegMsg(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_HandleNegMsg_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).HandleNegMsg(ctx, req.(*NegMsgRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_HandleNegClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(NegCloseRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).HandleNegClose(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_HandleNegClose_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).HandleNegClose(ctx, req.(*NegCloseRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_SyncWithPeer_Handler(srv interface{}, stream grpc.ServerStream) error { |
|
m := new(SyncPeerRequest) |
|
if err := stream.RecvMsg(m); err != nil { |
|
return err |
|
} |
|
return srv.(NegentropyServiceServer).SyncWithPeer(m, &grpc.GenericServerStream[SyncPeerRequest, SyncProgress]{ServerStream: stream}) |
|
} |
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
|
type NegentropyService_SyncWithPeerServer = grpc.ServerStreamingServer[SyncProgress] |
|
|
|
func _NegentropyService_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.(NegentropyServiceServer).GetSyncStatus(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_GetSyncStatus_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).GetSyncStatus(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_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.(NegentropyServiceServer).GetPeers(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_GetPeers_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).GetPeers(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(AddPeerRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).AddPeer(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_AddPeer_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).AddPeer(ctx, req.(*AddPeerRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_RemovePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(RemovePeerRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).RemovePeer(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_RemovePeer_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).RemovePeer(ctx, req.(*RemovePeerRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_TriggerSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(TriggerSyncRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).TriggerSync(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_TriggerSync_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).TriggerSync(ctx, req.(*TriggerSyncRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_GetPeerSyncState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(PeerSyncStateRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).GetPeerSyncState(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_GetPeerSyncState_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).GetPeerSyncState(ctx, req.(*PeerSyncStateRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_ListSessions_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.(NegentropyServiceServer).ListSessions(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_ListSessions_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).ListSessions(ctx, req.(*v1.Empty)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
func _NegentropyService_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
in := new(CloseSessionRequest) |
|
if err := dec(in); err != nil { |
|
return nil, err |
|
} |
|
if interceptor == nil { |
|
return srv.(NegentropyServiceServer).CloseSession(ctx, in) |
|
} |
|
info := &grpc.UnaryServerInfo{ |
|
Server: srv, |
|
FullMethod: NegentropyService_CloseSession_FullMethodName, |
|
} |
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
return srv.(NegentropyServiceServer).CloseSession(ctx, req.(*CloseSessionRequest)) |
|
} |
|
return interceptor(ctx, in, info, handler) |
|
} |
|
|
|
// NegentropyService_ServiceDesc is the grpc.ServiceDesc for NegentropyService service. |
|
// It's only intended for direct use with grpc.RegisterService, |
|
// and not to be introspected or modified (even as a copy) |
|
var NegentropyService_ServiceDesc = grpc.ServiceDesc{ |
|
ServiceName: "orlysync.negentropy.v1.NegentropyService", |
|
HandlerType: (*NegentropyServiceServer)(nil), |
|
Methods: []grpc.MethodDesc{ |
|
{ |
|
MethodName: "Ready", |
|
Handler: _NegentropyService_Ready_Handler, |
|
}, |
|
{ |
|
MethodName: "Start", |
|
Handler: _NegentropyService_Start_Handler, |
|
}, |
|
{ |
|
MethodName: "Stop", |
|
Handler: _NegentropyService_Stop_Handler, |
|
}, |
|
{ |
|
MethodName: "HandleNegOpen", |
|
Handler: _NegentropyService_HandleNegOpen_Handler, |
|
}, |
|
{ |
|
MethodName: "HandleNegMsg", |
|
Handler: _NegentropyService_HandleNegMsg_Handler, |
|
}, |
|
{ |
|
MethodName: "HandleNegClose", |
|
Handler: _NegentropyService_HandleNegClose_Handler, |
|
}, |
|
{ |
|
MethodName: "GetSyncStatus", |
|
Handler: _NegentropyService_GetSyncStatus_Handler, |
|
}, |
|
{ |
|
MethodName: "GetPeers", |
|
Handler: _NegentropyService_GetPeers_Handler, |
|
}, |
|
{ |
|
MethodName: "AddPeer", |
|
Handler: _NegentropyService_AddPeer_Handler, |
|
}, |
|
{ |
|
MethodName: "RemovePeer", |
|
Handler: _NegentropyService_RemovePeer_Handler, |
|
}, |
|
{ |
|
MethodName: "TriggerSync", |
|
Handler: _NegentropyService_TriggerSync_Handler, |
|
}, |
|
{ |
|
MethodName: "GetPeerSyncState", |
|
Handler: _NegentropyService_GetPeerSyncState_Handler, |
|
}, |
|
{ |
|
MethodName: "ListSessions", |
|
Handler: _NegentropyService_ListSessions_Handler, |
|
}, |
|
{ |
|
MethodName: "CloseSession", |
|
Handler: _NegentropyService_CloseSession_Handler, |
|
}, |
|
}, |
|
Streams: []grpc.StreamDesc{ |
|
{ |
|
StreamName: "SyncWithPeer", |
|
Handler: _NegentropyService_SyncWithPeer_Handler, |
|
ServerStreams: true, |
|
}, |
|
}, |
|
Metadata: "orlysync/negentropy/v1/service.proto", |
|
}
|
|
|