github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/remote/remote_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v4.24.3
     5  // source: remote.proto
     6  
     7  package remote
     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  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // RemotingClient is the client API for Remoting service.
    22  //
    23  // 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.
    24  type RemotingClient interface {
    25  	Receive(ctx context.Context, opts ...grpc.CallOption) (Remoting_ReceiveClient, error)
    26  	ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error)
    27  	GetProcessDiagnostics(ctx context.Context, in *GetProcessDiagnosticsRequest, opts ...grpc.CallOption) (*GetProcessDiagnosticsResponse, error)
    28  }
    29  
    30  type remotingClient struct {
    31  	cc grpc.ClientConnInterface
    32  }
    33  
    34  func NewRemotingClient(cc grpc.ClientConnInterface) RemotingClient {
    35  	return &remotingClient{cc}
    36  }
    37  
    38  func (c *remotingClient) Receive(ctx context.Context, opts ...grpc.CallOption) (Remoting_ReceiveClient, error) {
    39  	stream, err := c.cc.NewStream(ctx, &Remoting_ServiceDesc.Streams[0], "/remote.Remoting/Receive", opts...)
    40  	if err != nil {
    41  		return nil, err
    42  	}
    43  	x := &remotingReceiveClient{stream}
    44  	return x, nil
    45  }
    46  
    47  type Remoting_ReceiveClient interface {
    48  	Send(*RemoteMessage) error
    49  	Recv() (*RemoteMessage, error)
    50  	grpc.ClientStream
    51  }
    52  
    53  type remotingReceiveClient struct {
    54  	grpc.ClientStream
    55  }
    56  
    57  func (x *remotingReceiveClient) Send(m *RemoteMessage) error {
    58  	return x.ClientStream.SendMsg(m)
    59  }
    60  
    61  func (x *remotingReceiveClient) Recv() (*RemoteMessage, error) {
    62  	m := new(RemoteMessage)
    63  	if err := x.ClientStream.RecvMsg(m); err != nil {
    64  		return nil, err
    65  	}
    66  	return m, nil
    67  }
    68  
    69  func (c *remotingClient) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error) {
    70  	out := new(ListProcessesResponse)
    71  	err := c.cc.Invoke(ctx, "/remote.Remoting/ListProcesses", in, out, opts...)
    72  	if err != nil {
    73  		return nil, err
    74  	}
    75  	return out, nil
    76  }
    77  
    78  func (c *remotingClient) GetProcessDiagnostics(ctx context.Context, in *GetProcessDiagnosticsRequest, opts ...grpc.CallOption) (*GetProcessDiagnosticsResponse, error) {
    79  	out := new(GetProcessDiagnosticsResponse)
    80  	err := c.cc.Invoke(ctx, "/remote.Remoting/GetProcessDiagnostics", in, out, opts...)
    81  	if err != nil {
    82  		return nil, err
    83  	}
    84  	return out, nil
    85  }
    86  
    87  // RemotingServer is the server API for Remoting service.
    88  // All implementations must embed UnimplementedRemotingServer
    89  // for forward compatibility
    90  type RemotingServer interface {
    91  	Receive(Remoting_ReceiveServer) error
    92  	ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error)
    93  	GetProcessDiagnostics(context.Context, *GetProcessDiagnosticsRequest) (*GetProcessDiagnosticsResponse, error)
    94  	mustEmbedUnimplementedRemotingServer()
    95  }
    96  
    97  // UnimplementedRemotingServer must be embedded to have forward compatible implementations.
    98  type UnimplementedRemotingServer struct {
    99  }
   100  
   101  func (UnimplementedRemotingServer) Receive(Remoting_ReceiveServer) error {
   102  	return status.Errorf(codes.Unimplemented, "method Receive not implemented")
   103  }
   104  func (UnimplementedRemotingServer) ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error) {
   105  	return nil, status.Errorf(codes.Unimplemented, "method ListProcesses not implemented")
   106  }
   107  func (UnimplementedRemotingServer) GetProcessDiagnostics(context.Context, *GetProcessDiagnosticsRequest) (*GetProcessDiagnosticsResponse, error) {
   108  	return nil, status.Errorf(codes.Unimplemented, "method GetProcessDiagnostics not implemented")
   109  }
   110  func (UnimplementedRemotingServer) mustEmbedUnimplementedRemotingServer() {}
   111  
   112  // UnsafeRemotingServer may be embedded to opt out of forward compatibility for this service.
   113  // Use of this interface is not recommended, as added methods to RemotingServer will
   114  // result in compilation errors.
   115  type UnsafeRemotingServer interface {
   116  	mustEmbedUnimplementedRemotingServer()
   117  }
   118  
   119  func RegisterRemotingServer(s grpc.ServiceRegistrar, srv RemotingServer) {
   120  	s.RegisterService(&Remoting_ServiceDesc, srv)
   121  }
   122  
   123  func _Remoting_Receive_Handler(srv interface{}, stream grpc.ServerStream) error {
   124  	return srv.(RemotingServer).Receive(&remotingReceiveServer{stream})
   125  }
   126  
   127  type Remoting_ReceiveServer interface {
   128  	Send(*RemoteMessage) error
   129  	Recv() (*RemoteMessage, error)
   130  	grpc.ServerStream
   131  }
   132  
   133  type remotingReceiveServer struct {
   134  	grpc.ServerStream
   135  }
   136  
   137  func (x *remotingReceiveServer) Send(m *RemoteMessage) error {
   138  	return x.ServerStream.SendMsg(m)
   139  }
   140  
   141  func (x *remotingReceiveServer) Recv() (*RemoteMessage, error) {
   142  	m := new(RemoteMessage)
   143  	if err := x.ServerStream.RecvMsg(m); err != nil {
   144  		return nil, err
   145  	}
   146  	return m, nil
   147  }
   148  
   149  func _Remoting_ListProcesses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   150  	in := new(ListProcessesRequest)
   151  	if err := dec(in); err != nil {
   152  		return nil, err
   153  	}
   154  	if interceptor == nil {
   155  		return srv.(RemotingServer).ListProcesses(ctx, in)
   156  	}
   157  	info := &grpc.UnaryServerInfo{
   158  		Server:     srv,
   159  		FullMethod: "/remote.Remoting/ListProcesses",
   160  	}
   161  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   162  		return srv.(RemotingServer).ListProcesses(ctx, req.(*ListProcessesRequest))
   163  	}
   164  	return interceptor(ctx, in, info, handler)
   165  }
   166  
   167  func _Remoting_GetProcessDiagnostics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   168  	in := new(GetProcessDiagnosticsRequest)
   169  	if err := dec(in); err != nil {
   170  		return nil, err
   171  	}
   172  	if interceptor == nil {
   173  		return srv.(RemotingServer).GetProcessDiagnostics(ctx, in)
   174  	}
   175  	info := &grpc.UnaryServerInfo{
   176  		Server:     srv,
   177  		FullMethod: "/remote.Remoting/GetProcessDiagnostics",
   178  	}
   179  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   180  		return srv.(RemotingServer).GetProcessDiagnostics(ctx, req.(*GetProcessDiagnosticsRequest))
   181  	}
   182  	return interceptor(ctx, in, info, handler)
   183  }
   184  
   185  // Remoting_ServiceDesc is the grpc.ServiceDesc for Remoting service.
   186  // It's only intended for direct use with grpc.RegisterService,
   187  // and not to be introspected or modified (even as a copy)
   188  var Remoting_ServiceDesc = grpc.ServiceDesc{
   189  	ServiceName: "remote.Remoting",
   190  	HandlerType: (*RemotingServer)(nil),
   191  	Methods: []grpc.MethodDesc{
   192  		{
   193  			MethodName: "ListProcesses",
   194  			Handler:    _Remoting_ListProcesses_Handler,
   195  		},
   196  		{
   197  			MethodName: "GetProcessDiagnostics",
   198  			Handler:    _Remoting_GetProcessDiagnostics_Handler,
   199  		},
   200  	},
   201  	Streams: []grpc.StreamDesc{
   202  		{
   203  			StreamName:    "Receive",
   204  			Handler:       _Remoting_Receive_Handler,
   205  			ServerStreams: true,
   206  			ClientStreams: true,
   207  		},
   208  	},
   209  	Metadata: "remote.proto",
   210  }