github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/enginepb/datarw_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package enginepb
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  // Requires gRPC-Go v1.32.0 or later.
    15  const _ = grpc.SupportPackageIsVersion7
    16  
    17  // DataRWServiceClient is the client API for DataRWService service.
    18  //
    19  // 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.
    20  type DataRWServiceClient interface {
    21  	ReadLines(ctx context.Context, in *ReadLinesRequest, opts ...grpc.CallOption) (DataRWService_ReadLinesClient, error)
    22  	WriteLines(ctx context.Context, opts ...grpc.CallOption) (DataRWService_WriteLinesClient, error)
    23  	GenerateData(ctx context.Context, in *GenerateDataRequest, opts ...grpc.CallOption) (*GenerateDataResponse, error)
    24  	ListFiles(ctx context.Context, in *ListFilesReq, opts ...grpc.CallOption) (*ListFilesResponse, error)
    25  	IsReady(ctx context.Context, in *IsReadyRequest, opts ...grpc.CallOption) (*IsReadyResponse, error)
    26  	CheckDir(ctx context.Context, in *CheckDirRequest, opts ...grpc.CallOption) (*CheckDirResponse, error)
    27  }
    28  
    29  type dataRWServiceClient struct {
    30  	cc grpc.ClientConnInterface
    31  }
    32  
    33  func NewDataRWServiceClient(cc grpc.ClientConnInterface) DataRWServiceClient {
    34  	return &dataRWServiceClient{cc}
    35  }
    36  
    37  func (c *dataRWServiceClient) ReadLines(ctx context.Context, in *ReadLinesRequest, opts ...grpc.CallOption) (DataRWService_ReadLinesClient, error) {
    38  	stream, err := c.cc.NewStream(ctx, &DataRWService_ServiceDesc.Streams[0], "/enginepb.DataRWService/ReadLines", opts...)
    39  	if err != nil {
    40  		return nil, err
    41  	}
    42  	x := &dataRWServiceReadLinesClient{stream}
    43  	if err := x.ClientStream.SendMsg(in); err != nil {
    44  		return nil, err
    45  	}
    46  	if err := x.ClientStream.CloseSend(); err != nil {
    47  		return nil, err
    48  	}
    49  	return x, nil
    50  }
    51  
    52  type DataRWService_ReadLinesClient interface {
    53  	Recv() (*ReadLinesResponse, error)
    54  	grpc.ClientStream
    55  }
    56  
    57  type dataRWServiceReadLinesClient struct {
    58  	grpc.ClientStream
    59  }
    60  
    61  func (x *dataRWServiceReadLinesClient) Recv() (*ReadLinesResponse, error) {
    62  	m := new(ReadLinesResponse)
    63  	if err := x.ClientStream.RecvMsg(m); err != nil {
    64  		return nil, err
    65  	}
    66  	return m, nil
    67  }
    68  
    69  func (c *dataRWServiceClient) WriteLines(ctx context.Context, opts ...grpc.CallOption) (DataRWService_WriteLinesClient, error) {
    70  	stream, err := c.cc.NewStream(ctx, &DataRWService_ServiceDesc.Streams[1], "/enginepb.DataRWService/WriteLines", opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	x := &dataRWServiceWriteLinesClient{stream}
    75  	return x, nil
    76  }
    77  
    78  type DataRWService_WriteLinesClient interface {
    79  	Send(*WriteLinesRequest) error
    80  	CloseAndRecv() (*WriteLinesResponse, error)
    81  	grpc.ClientStream
    82  }
    83  
    84  type dataRWServiceWriteLinesClient struct {
    85  	grpc.ClientStream
    86  }
    87  
    88  func (x *dataRWServiceWriteLinesClient) Send(m *WriteLinesRequest) error {
    89  	return x.ClientStream.SendMsg(m)
    90  }
    91  
    92  func (x *dataRWServiceWriteLinesClient) CloseAndRecv() (*WriteLinesResponse, error) {
    93  	if err := x.ClientStream.CloseSend(); err != nil {
    94  		return nil, err
    95  	}
    96  	m := new(WriteLinesResponse)
    97  	if err := x.ClientStream.RecvMsg(m); err != nil {
    98  		return nil, err
    99  	}
   100  	return m, nil
   101  }
   102  
   103  func (c *dataRWServiceClient) GenerateData(ctx context.Context, in *GenerateDataRequest, opts ...grpc.CallOption) (*GenerateDataResponse, error) {
   104  	out := new(GenerateDataResponse)
   105  	err := c.cc.Invoke(ctx, "/enginepb.DataRWService/GenerateData", in, out, opts...)
   106  	if err != nil {
   107  		return nil, err
   108  	}
   109  	return out, nil
   110  }
   111  
   112  func (c *dataRWServiceClient) ListFiles(ctx context.Context, in *ListFilesReq, opts ...grpc.CallOption) (*ListFilesResponse, error) {
   113  	out := new(ListFilesResponse)
   114  	err := c.cc.Invoke(ctx, "/enginepb.DataRWService/ListFiles", in, out, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	return out, nil
   119  }
   120  
   121  func (c *dataRWServiceClient) IsReady(ctx context.Context, in *IsReadyRequest, opts ...grpc.CallOption) (*IsReadyResponse, error) {
   122  	out := new(IsReadyResponse)
   123  	err := c.cc.Invoke(ctx, "/enginepb.DataRWService/IsReady", in, out, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	return out, nil
   128  }
   129  
   130  func (c *dataRWServiceClient) CheckDir(ctx context.Context, in *CheckDirRequest, opts ...grpc.CallOption) (*CheckDirResponse, error) {
   131  	out := new(CheckDirResponse)
   132  	err := c.cc.Invoke(ctx, "/enginepb.DataRWService/CheckDir", in, out, opts...)
   133  	if err != nil {
   134  		return nil, err
   135  	}
   136  	return out, nil
   137  }
   138  
   139  // DataRWServiceServer is the server API for DataRWService service.
   140  // All implementations should embed UnimplementedDataRWServiceServer
   141  // for forward compatibility
   142  type DataRWServiceServer interface {
   143  	ReadLines(*ReadLinesRequest, DataRWService_ReadLinesServer) error
   144  	WriteLines(DataRWService_WriteLinesServer) error
   145  	GenerateData(context.Context, *GenerateDataRequest) (*GenerateDataResponse, error)
   146  	ListFiles(context.Context, *ListFilesReq) (*ListFilesResponse, error)
   147  	IsReady(context.Context, *IsReadyRequest) (*IsReadyResponse, error)
   148  	CheckDir(context.Context, *CheckDirRequest) (*CheckDirResponse, error)
   149  }
   150  
   151  // UnimplementedDataRWServiceServer should be embedded to have forward compatible implementations.
   152  type UnimplementedDataRWServiceServer struct {
   153  }
   154  
   155  func (UnimplementedDataRWServiceServer) ReadLines(*ReadLinesRequest, DataRWService_ReadLinesServer) error {
   156  	return status.Errorf(codes.Unimplemented, "method ReadLines not implemented")
   157  }
   158  func (UnimplementedDataRWServiceServer) WriteLines(DataRWService_WriteLinesServer) error {
   159  	return status.Errorf(codes.Unimplemented, "method WriteLines not implemented")
   160  }
   161  func (UnimplementedDataRWServiceServer) GenerateData(context.Context, *GenerateDataRequest) (*GenerateDataResponse, error) {
   162  	return nil, status.Errorf(codes.Unimplemented, "method GenerateData not implemented")
   163  }
   164  func (UnimplementedDataRWServiceServer) ListFiles(context.Context, *ListFilesReq) (*ListFilesResponse, error) {
   165  	return nil, status.Errorf(codes.Unimplemented, "method ListFiles not implemented")
   166  }
   167  func (UnimplementedDataRWServiceServer) IsReady(context.Context, *IsReadyRequest) (*IsReadyResponse, error) {
   168  	return nil, status.Errorf(codes.Unimplemented, "method IsReady not implemented")
   169  }
   170  func (UnimplementedDataRWServiceServer) CheckDir(context.Context, *CheckDirRequest) (*CheckDirResponse, error) {
   171  	return nil, status.Errorf(codes.Unimplemented, "method CheckDir not implemented")
   172  }
   173  
   174  // UnsafeDataRWServiceServer may be embedded to opt out of forward compatibility for this service.
   175  // Use of this interface is not recommended, as added methods to DataRWServiceServer will
   176  // result in compilation errors.
   177  type UnsafeDataRWServiceServer interface {
   178  	mustEmbedUnimplementedDataRWServiceServer()
   179  }
   180  
   181  func RegisterDataRWServiceServer(s grpc.ServiceRegistrar, srv DataRWServiceServer) {
   182  	s.RegisterService(&DataRWService_ServiceDesc, srv)
   183  }
   184  
   185  func _DataRWService_ReadLines_Handler(srv interface{}, stream grpc.ServerStream) error {
   186  	m := new(ReadLinesRequest)
   187  	if err := stream.RecvMsg(m); err != nil {
   188  		return err
   189  	}
   190  	return srv.(DataRWServiceServer).ReadLines(m, &dataRWServiceReadLinesServer{stream})
   191  }
   192  
   193  type DataRWService_ReadLinesServer interface {
   194  	Send(*ReadLinesResponse) error
   195  	grpc.ServerStream
   196  }
   197  
   198  type dataRWServiceReadLinesServer struct {
   199  	grpc.ServerStream
   200  }
   201  
   202  func (x *dataRWServiceReadLinesServer) Send(m *ReadLinesResponse) error {
   203  	return x.ServerStream.SendMsg(m)
   204  }
   205  
   206  func _DataRWService_WriteLines_Handler(srv interface{}, stream grpc.ServerStream) error {
   207  	return srv.(DataRWServiceServer).WriteLines(&dataRWServiceWriteLinesServer{stream})
   208  }
   209  
   210  type DataRWService_WriteLinesServer interface {
   211  	SendAndClose(*WriteLinesResponse) error
   212  	Recv() (*WriteLinesRequest, error)
   213  	grpc.ServerStream
   214  }
   215  
   216  type dataRWServiceWriteLinesServer struct {
   217  	grpc.ServerStream
   218  }
   219  
   220  func (x *dataRWServiceWriteLinesServer) SendAndClose(m *WriteLinesResponse) error {
   221  	return x.ServerStream.SendMsg(m)
   222  }
   223  
   224  func (x *dataRWServiceWriteLinesServer) Recv() (*WriteLinesRequest, error) {
   225  	m := new(WriteLinesRequest)
   226  	if err := x.ServerStream.RecvMsg(m); err != nil {
   227  		return nil, err
   228  	}
   229  	return m, nil
   230  }
   231  
   232  func _DataRWService_GenerateData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   233  	in := new(GenerateDataRequest)
   234  	if err := dec(in); err != nil {
   235  		return nil, err
   236  	}
   237  	if interceptor == nil {
   238  		return srv.(DataRWServiceServer).GenerateData(ctx, in)
   239  	}
   240  	info := &grpc.UnaryServerInfo{
   241  		Server:     srv,
   242  		FullMethod: "/enginepb.DataRWService/GenerateData",
   243  	}
   244  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   245  		return srv.(DataRWServiceServer).GenerateData(ctx, req.(*GenerateDataRequest))
   246  	}
   247  	return interceptor(ctx, in, info, handler)
   248  }
   249  
   250  func _DataRWService_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   251  	in := new(ListFilesReq)
   252  	if err := dec(in); err != nil {
   253  		return nil, err
   254  	}
   255  	if interceptor == nil {
   256  		return srv.(DataRWServiceServer).ListFiles(ctx, in)
   257  	}
   258  	info := &grpc.UnaryServerInfo{
   259  		Server:     srv,
   260  		FullMethod: "/enginepb.DataRWService/ListFiles",
   261  	}
   262  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   263  		return srv.(DataRWServiceServer).ListFiles(ctx, req.(*ListFilesReq))
   264  	}
   265  	return interceptor(ctx, in, info, handler)
   266  }
   267  
   268  func _DataRWService_IsReady_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   269  	in := new(IsReadyRequest)
   270  	if err := dec(in); err != nil {
   271  		return nil, err
   272  	}
   273  	if interceptor == nil {
   274  		return srv.(DataRWServiceServer).IsReady(ctx, in)
   275  	}
   276  	info := &grpc.UnaryServerInfo{
   277  		Server:     srv,
   278  		FullMethod: "/enginepb.DataRWService/IsReady",
   279  	}
   280  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   281  		return srv.(DataRWServiceServer).IsReady(ctx, req.(*IsReadyRequest))
   282  	}
   283  	return interceptor(ctx, in, info, handler)
   284  }
   285  
   286  func _DataRWService_CheckDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   287  	in := new(CheckDirRequest)
   288  	if err := dec(in); err != nil {
   289  		return nil, err
   290  	}
   291  	if interceptor == nil {
   292  		return srv.(DataRWServiceServer).CheckDir(ctx, in)
   293  	}
   294  	info := &grpc.UnaryServerInfo{
   295  		Server:     srv,
   296  		FullMethod: "/enginepb.DataRWService/CheckDir",
   297  	}
   298  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   299  		return srv.(DataRWServiceServer).CheckDir(ctx, req.(*CheckDirRequest))
   300  	}
   301  	return interceptor(ctx, in, info, handler)
   302  }
   303  
   304  // DataRWService_ServiceDesc is the grpc.ServiceDesc for DataRWService service.
   305  // It's only intended for direct use with grpc.RegisterService,
   306  // and not to be introspected or modified (even as a copy)
   307  var DataRWService_ServiceDesc = grpc.ServiceDesc{
   308  	ServiceName: "enginepb.DataRWService",
   309  	HandlerType: (*DataRWServiceServer)(nil),
   310  	Methods: []grpc.MethodDesc{
   311  		{
   312  			MethodName: "GenerateData",
   313  			Handler:    _DataRWService_GenerateData_Handler,
   314  		},
   315  		{
   316  			MethodName: "ListFiles",
   317  			Handler:    _DataRWService_ListFiles_Handler,
   318  		},
   319  		{
   320  			MethodName: "IsReady",
   321  			Handler:    _DataRWService_IsReady_Handler,
   322  		},
   323  		{
   324  			MethodName: "CheckDir",
   325  			Handler:    _DataRWService_CheckDir_Handler,
   326  		},
   327  	},
   328  	Streams: []grpc.StreamDesc{
   329  		{
   330  			StreamName:    "ReadLines",
   331  			Handler:       _DataRWService_ReadLines_Handler,
   332  			ServerStreams: true,
   333  		},
   334  		{
   335  			StreamName:    "WriteLines",
   336  			Handler:       _DataRWService_WriteLines_Handler,
   337  			ClientStreams: true,
   338  		},
   339  	},
   340  	Metadata: "engine/proto/datarw.proto",
   341  }