// Code generated by protoc-gen-go-grpc. DO NOT EDIT. package echo import ( context "context" httpbody "google.golang.org/genproto/googleapis/api/httpbody" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // 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 // StreamServiceClient is the client API for StreamService 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 StreamServiceClient interface { Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error) } type streamServiceClient struct { cc grpc.ClientConnInterface } func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient { return &streamServiceClient{cc} } func (c *streamServiceClient) Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error) { stream, err := c.cc.NewStream(ctx, &StreamService_ServiceDesc.Streams[0], "/echo.StreamService/Download", opts...) if err != nil { return nil, err } x := &streamServiceDownloadClient{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 StreamService_DownloadClient interface { Recv() (*httpbody.HttpBody, error) grpc.ClientStream } type streamServiceDownloadClient struct { grpc.ClientStream } func (x *streamServiceDownloadClient) Recv() (*httpbody.HttpBody, error) { m := new(httpbody.HttpBody) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // StreamServiceServer is the server API for StreamService service. // All implementations must embed UnimplementedStreamServiceServer // for forward compatibility type StreamServiceServer interface { Download(*emptypb.Empty, StreamService_DownloadServer) error mustEmbedUnimplementedStreamServiceServer() } // UnimplementedStreamServiceServer must be embedded to have forward compatible implementations. type UnimplementedStreamServiceServer struct { } func (UnimplementedStreamServiceServer) Download(*emptypb.Empty, StreamService_DownloadServer) error { return status.Errorf(codes.Unimplemented, "method Download not implemented") } func (UnimplementedStreamServiceServer) mustEmbedUnimplementedStreamServiceServer() {} // UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StreamServiceServer will // result in compilation errors. type UnsafeStreamServiceServer interface { mustEmbedUnimplementedStreamServiceServer() } func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer) { s.RegisterService(&StreamService_ServiceDesc, srv) } func _StreamService_Download_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(emptypb.Empty) if err := stream.RecvMsg(m); err != nil { return err } return srv.(StreamServiceServer).Download(m, &streamServiceDownloadServer{stream}) } type StreamService_DownloadServer interface { Send(*httpbody.HttpBody) error grpc.ServerStream } type streamServiceDownloadServer struct { grpc.ServerStream } func (x *streamServiceDownloadServer) Send(m *httpbody.HttpBody) error { return x.ServerStream.SendMsg(m) } // StreamService_ServiceDesc is the grpc.ServiceDesc for StreamService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StreamService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "echo.StreamService", HandlerType: (*StreamServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Download", Handler: _StreamService_Download_Handler, ServerStreams: true, }, }, Metadata: "stream.proto", }