123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
- package fho_forward_proto
- import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- )
- // 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.32.0 or later.
- const _ = grpc.SupportPackageIsVersion7
- // DataServiceClient is the client API for DataService 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.
- type DataServiceClient interface {
- GetData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*DataReply, error)
- StreamData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (DataService_StreamDataClient, error)
- }
- type dataServiceClient struct {
- cc grpc.ClientConnInterface
- }
- func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient {
- return &dataServiceClient{cc}
- }
- func (c *dataServiceClient) GetData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*DataReply, error) {
- out := new(DataReply)
- err := c.cc.Invoke(ctx, "/fho.DataService/GetData", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *dataServiceClient) StreamData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (DataService_StreamDataClient, error) {
- stream, err := c.cc.NewStream(ctx, &DataService_ServiceDesc.Streams[0], "/fho.DataService/StreamData", opts...)
- if err != nil {
- return nil, err
- }
- x := &dataServiceStreamDataClient{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
- }
- type DataService_StreamDataClient interface {
- Recv() (*DataReply, error)
- grpc.ClientStream
- }
- type dataServiceStreamDataClient struct {
- grpc.ClientStream
- }
- func (x *dataServiceStreamDataClient) Recv() (*DataReply, error) {
- m := new(DataReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- // DataServiceServer is the server API for DataService service.
- // All implementations must embed UnimplementedDataServiceServer
- // for forward compatibility
- type DataServiceServer interface {
- GetData(context.Context, *DataRequest) (*DataReply, error)
- StreamData(*DataRequest, DataService_StreamDataServer) error
- mustEmbedUnimplementedDataServiceServer()
- }
- // UnimplementedDataServiceServer must be embedded to have forward compatible implementations.
- type UnimplementedDataServiceServer struct {
- }
- func (UnimplementedDataServiceServer) GetData(context.Context, *DataRequest) (*DataReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetData not implemented")
- }
- func (UnimplementedDataServiceServer) StreamData(*DataRequest, DataService_StreamDataServer) error {
- return status.Errorf(codes.Unimplemented, "method StreamData not implemented")
- }
- func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {}
- // UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service.
- // Use of this interface is not recommended, as added methods to DataServiceServer will
- // result in compilation errors.
- type UnsafeDataServiceServer interface {
- mustEmbedUnimplementedDataServiceServer()
- }
- func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) {
- s.RegisterService(&DataService_ServiceDesc, srv)
- }
- func _DataService_GetData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DataRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DataServiceServer).GetData(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/fho.DataService/GetData",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DataServiceServer).GetData(ctx, req.(*DataRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _DataService_StreamData_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(DataRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(DataServiceServer).StreamData(m, &dataServiceStreamDataServer{stream})
- }
- type DataService_StreamDataServer interface {
- Send(*DataReply) error
- grpc.ServerStream
- }
- type dataServiceStreamDataServer struct {
- grpc.ServerStream
- }
- func (x *dataServiceStreamDataServer) Send(m *DataReply) error {
- return x.ServerStream.SendMsg(m)
- }
- // DataService_ServiceDesc is the grpc.ServiceDesc for DataService service.
- // It's only intended for direct use with grpc.RegisterService,
- // and not to be introspected or modified (even as a copy)
- var DataService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "fho.DataService",
- HandlerType: (*DataServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "GetData",
- Handler: _DataService_GetData_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "StreamData",
- Handler: _DataService_StreamData_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "data.proto",
- }
|