// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.21.6 // source: pkg/apis/dfdaemon/v2/dfdaemon.proto package dfdaemon import ( context "context" v2 "d7y.io/api/v2/pkg/apis/common/v2" 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 // DfdaemonUploadClient is the client API for DfdaemonUpload 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 DfdaemonUploadClient interface { // DownloadTask downloads task from p2p network. DownloadTask(ctx context.Context, in *DownloadTaskRequest, opts ...grpc.CallOption) (DfdaemonUpload_DownloadTaskClient, error) // StatTask stats task information. StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) // DeleteTask deletes task from p2p network. DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // SyncPieces syncs piece metadatas from remote peer. SyncPieces(ctx context.Context, in *SyncPiecesRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncPiecesClient, error) // DownloadPiece downloads piece from the remote peer. DownloadPiece(ctx context.Context, in *DownloadPieceRequest, opts ...grpc.CallOption) (*DownloadPieceResponse, error) // DownloadPersistentCacheTask downloads persistent cache task from p2p network. DownloadPersistentCacheTask(ctx context.Context, in *DownloadPersistentCacheTaskRequest, opts ...grpc.CallOption) (DfdaemonUpload_DownloadPersistentCacheTaskClient, error) // StatPersistentCacheTask stats persistent cache task information. StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) // DeletePersistentCacheTask deletes persistent cache task from p2p network. DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type dfdaemonUploadClient struct { cc grpc.ClientConnInterface } func NewDfdaemonUploadClient(cc grpc.ClientConnInterface) DfdaemonUploadClient { return &dfdaemonUploadClient{cc} } func (c *dfdaemonUploadClient) DownloadTask(ctx context.Context, in *DownloadTaskRequest, opts ...grpc.CallOption) (DfdaemonUpload_DownloadTaskClient, error) { stream, err := c.cc.NewStream(ctx, &DfdaemonUpload_ServiceDesc.Streams[0], "/dfdaemon.v2.DfdaemonUpload/DownloadTask", opts...) if err != nil { return nil, err } x := &dfdaemonUploadDownloadTaskClient{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 DfdaemonUpload_DownloadTaskClient interface { Recv() (*DownloadTaskResponse, error) grpc.ClientStream } type dfdaemonUploadDownloadTaskClient struct { grpc.ClientStream } func (x *dfdaemonUploadDownloadTaskClient) Recv() (*DownloadTaskResponse, error) { m := new(DownloadTaskResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *dfdaemonUploadClient) StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) { out := new(v2.Task) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/StatTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonUploadClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/DeleteTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonUploadClient) SyncPieces(ctx context.Context, in *SyncPiecesRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncPiecesClient, error) { stream, err := c.cc.NewStream(ctx, &DfdaemonUpload_ServiceDesc.Streams[1], "/dfdaemon.v2.DfdaemonUpload/SyncPieces", opts...) if err != nil { return nil, err } x := &dfdaemonUploadSyncPiecesClient{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 DfdaemonUpload_SyncPiecesClient interface { Recv() (*SyncPiecesResponse, error) grpc.ClientStream } type dfdaemonUploadSyncPiecesClient struct { grpc.ClientStream } func (x *dfdaemonUploadSyncPiecesClient) Recv() (*SyncPiecesResponse, error) { m := new(SyncPiecesResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *dfdaemonUploadClient) DownloadPiece(ctx context.Context, in *DownloadPieceRequest, opts ...grpc.CallOption) (*DownloadPieceResponse, error) { out := new(DownloadPieceResponse) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/DownloadPiece", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonUploadClient) DownloadPersistentCacheTask(ctx context.Context, in *DownloadPersistentCacheTaskRequest, opts ...grpc.CallOption) (DfdaemonUpload_DownloadPersistentCacheTaskClient, error) { stream, err := c.cc.NewStream(ctx, &DfdaemonUpload_ServiceDesc.Streams[2], "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCacheTask", opts...) if err != nil { return nil, err } x := &dfdaemonUploadDownloadPersistentCacheTaskClient{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 DfdaemonUpload_DownloadPersistentCacheTaskClient interface { Recv() (*DownloadPersistentCacheTaskResponse, error) grpc.ClientStream } type dfdaemonUploadDownloadPersistentCacheTaskClient struct { grpc.ClientStream } func (x *dfdaemonUploadDownloadPersistentCacheTaskClient) Recv() (*DownloadPersistentCacheTaskResponse, error) { m := new(DownloadPersistentCacheTaskResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *dfdaemonUploadClient) StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) { out := new(v2.PersistentCacheTask) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonUploadClient) DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask", in, out, opts...) if err != nil { return nil, err } return out, nil } // DfdaemonUploadServer is the server API for DfdaemonUpload service. // All implementations should embed UnimplementedDfdaemonUploadServer // for forward compatibility type DfdaemonUploadServer interface { // DownloadTask downloads task from p2p network. DownloadTask(*DownloadTaskRequest, DfdaemonUpload_DownloadTaskServer) error // StatTask stats task information. StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) // DeleteTask deletes task from p2p network. DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) // SyncPieces syncs piece metadatas from remote peer. SyncPieces(*SyncPiecesRequest, DfdaemonUpload_SyncPiecesServer) error // DownloadPiece downloads piece from the remote peer. DownloadPiece(context.Context, *DownloadPieceRequest) (*DownloadPieceResponse, error) // DownloadPersistentCacheTask downloads persistent cache task from p2p network. DownloadPersistentCacheTask(*DownloadPersistentCacheTaskRequest, DfdaemonUpload_DownloadPersistentCacheTaskServer) error // StatPersistentCacheTask stats persistent cache task information. StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) // DeletePersistentCacheTask deletes persistent cache task from p2p network. DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) } // UnimplementedDfdaemonUploadServer should be embedded to have forward compatible implementations. type UnimplementedDfdaemonUploadServer struct { } func (UnimplementedDfdaemonUploadServer) DownloadTask(*DownloadTaskRequest, DfdaemonUpload_DownloadTaskServer) error { return status.Errorf(codes.Unimplemented, "method DownloadTask not implemented") } func (UnimplementedDfdaemonUploadServer) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) { return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented") } func (UnimplementedDfdaemonUploadServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented") } func (UnimplementedDfdaemonUploadServer) SyncPieces(*SyncPiecesRequest, DfdaemonUpload_SyncPiecesServer) error { return status.Errorf(codes.Unimplemented, "method SyncPieces not implemented") } func (UnimplementedDfdaemonUploadServer) DownloadPiece(context.Context, *DownloadPieceRequest) (*DownloadPieceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DownloadPiece not implemented") } func (UnimplementedDfdaemonUploadServer) DownloadPersistentCacheTask(*DownloadPersistentCacheTaskRequest, DfdaemonUpload_DownloadPersistentCacheTaskServer) error { return status.Errorf(codes.Unimplemented, "method DownloadPersistentCacheTask not implemented") } func (UnimplementedDfdaemonUploadServer) StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) { return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCacheTask not implemented") } func (UnimplementedDfdaemonUploadServer) DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCacheTask not implemented") } // UnsafeDfdaemonUploadServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DfdaemonUploadServer will // result in compilation errors. type UnsafeDfdaemonUploadServer interface { mustEmbedUnimplementedDfdaemonUploadServer() } func RegisterDfdaemonUploadServer(s grpc.ServiceRegistrar, srv DfdaemonUploadServer) { s.RegisterService(&DfdaemonUpload_ServiceDesc, srv) } func _DfdaemonUpload_DownloadTask_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(DownloadTaskRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(DfdaemonUploadServer).DownloadTask(m, &dfdaemonUploadDownloadTaskServer{stream}) } type DfdaemonUpload_DownloadTaskServer interface { Send(*DownloadTaskResponse) error grpc.ServerStream } type dfdaemonUploadDownloadTaskServer struct { grpc.ServerStream } func (x *dfdaemonUploadDownloadTaskServer) Send(m *DownloadTaskResponse) error { return x.ServerStream.SendMsg(m) } func _DfdaemonUpload_StatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonUploadServer).StatTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonUpload/StatTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonUploadServer).StatTask(ctx, req.(*StatTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonUpload_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonUploadServer).DeleteTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonUpload/DeleteTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonUploadServer).DeleteTask(ctx, req.(*DeleteTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonUpload_SyncPieces_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SyncPiecesRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(DfdaemonUploadServer).SyncPieces(m, &dfdaemonUploadSyncPiecesServer{stream}) } type DfdaemonUpload_SyncPiecesServer interface { Send(*SyncPiecesResponse) error grpc.ServerStream } type dfdaemonUploadSyncPiecesServer struct { grpc.ServerStream } func (x *dfdaemonUploadSyncPiecesServer) Send(m *SyncPiecesResponse) error { return x.ServerStream.SendMsg(m) } func _DfdaemonUpload_DownloadPiece_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DownloadPieceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonUploadServer).DownloadPiece(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonUpload/DownloadPiece", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonUploadServer).DownloadPiece(ctx, req.(*DownloadPieceRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonUpload_DownloadPersistentCacheTask_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(DownloadPersistentCacheTaskRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(DfdaemonUploadServer).DownloadPersistentCacheTask(m, &dfdaemonUploadDownloadPersistentCacheTaskServer{stream}) } type DfdaemonUpload_DownloadPersistentCacheTaskServer interface { Send(*DownloadPersistentCacheTaskResponse) error grpc.ServerStream } type dfdaemonUploadDownloadPersistentCacheTaskServer struct { grpc.ServerStream } func (x *dfdaemonUploadDownloadPersistentCacheTaskServer) Send(m *DownloadPersistentCacheTaskResponse) error { return x.ServerStream.SendMsg(m) } func _DfdaemonUpload_StatPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatPersistentCacheTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonUploadServer).StatPersistentCacheTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonUploadServer).StatPersistentCacheTask(ctx, req.(*StatPersistentCacheTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonUpload_DeletePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeletePersistentCacheTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonUploadServer).DeletePersistentCacheTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonUploadServer).DeletePersistentCacheTask(ctx, req.(*DeletePersistentCacheTaskRequest)) } return interceptor(ctx, in, info, handler) } // DfdaemonUpload_ServiceDesc is the grpc.ServiceDesc for DfdaemonUpload service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var DfdaemonUpload_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dfdaemon.v2.DfdaemonUpload", HandlerType: (*DfdaemonUploadServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StatTask", Handler: _DfdaemonUpload_StatTask_Handler, }, { MethodName: "DeleteTask", Handler: _DfdaemonUpload_DeleteTask_Handler, }, { MethodName: "DownloadPiece", Handler: _DfdaemonUpload_DownloadPiece_Handler, }, { MethodName: "StatPersistentCacheTask", Handler: _DfdaemonUpload_StatPersistentCacheTask_Handler, }, { MethodName: "DeletePersistentCacheTask", Handler: _DfdaemonUpload_DeletePersistentCacheTask_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "DownloadTask", Handler: _DfdaemonUpload_DownloadTask_Handler, ServerStreams: true, }, { StreamName: "SyncPieces", Handler: _DfdaemonUpload_SyncPieces_Handler, ServerStreams: true, }, { StreamName: "DownloadPersistentCacheTask", Handler: _DfdaemonUpload_DownloadPersistentCacheTask_Handler, ServerStreams: true, }, }, Metadata: "pkg/apis/dfdaemon/v2/dfdaemon.proto", } // DfdaemonDownloadClient is the client API for DfdaemonDownload 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 DfdaemonDownloadClient interface { // DownloadTask downloads task from p2p network. DownloadTask(ctx context.Context, in *DownloadTaskRequest, opts ...grpc.CallOption) (DfdaemonDownload_DownloadTaskClient, error) // UploadTask uploads task to p2p network. UploadTask(ctx context.Context, in *UploadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // StatTask stats task information. StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) // DeleteTask deletes task from p2p network. DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // DeleteHost releases host in scheduler. DeleteHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) // DownloadPersistentCacheTask downloads persistent cache task from p2p network. DownloadPersistentCacheTask(ctx context.Context, in *DownloadPersistentCacheTaskRequest, opts ...grpc.CallOption) (DfdaemonDownload_DownloadPersistentCacheTaskClient, error) // UploadPersistentCacheTask uploads persistent cache task to p2p network. UploadPersistentCacheTask(ctx context.Context, in *UploadPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) // StatPersistentCacheTask stats persistent cache task information. StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) // DeletePersistentCacheTask deletes persistent cache task from p2p network. DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type dfdaemonDownloadClient struct { cc grpc.ClientConnInterface } func NewDfdaemonDownloadClient(cc grpc.ClientConnInterface) DfdaemonDownloadClient { return &dfdaemonDownloadClient{cc} } func (c *dfdaemonDownloadClient) DownloadTask(ctx context.Context, in *DownloadTaskRequest, opts ...grpc.CallOption) (DfdaemonDownload_DownloadTaskClient, error) { stream, err := c.cc.NewStream(ctx, &DfdaemonDownload_ServiceDesc.Streams[0], "/dfdaemon.v2.DfdaemonDownload/DownloadTask", opts...) if err != nil { return nil, err } x := &dfdaemonDownloadDownloadTaskClient{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 DfdaemonDownload_DownloadTaskClient interface { Recv() (*DownloadTaskResponse, error) grpc.ClientStream } type dfdaemonDownloadDownloadTaskClient struct { grpc.ClientStream } func (x *dfdaemonDownloadDownloadTaskClient) Recv() (*DownloadTaskResponse, error) { m := new(DownloadTaskResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *dfdaemonDownloadClient) UploadTask(ctx context.Context, in *UploadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/UploadTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) { out := new(v2.Task) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/StatTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/DeleteTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) DeleteHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/DeleteHost", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) DownloadPersistentCacheTask(ctx context.Context, in *DownloadPersistentCacheTaskRequest, opts ...grpc.CallOption) (DfdaemonDownload_DownloadPersistentCacheTaskClient, error) { stream, err := c.cc.NewStream(ctx, &DfdaemonDownload_ServiceDesc.Streams[1], "/dfdaemon.v2.DfdaemonDownload/DownloadPersistentCacheTask", opts...) if err != nil { return nil, err } x := &dfdaemonDownloadDownloadPersistentCacheTaskClient{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 DfdaemonDownload_DownloadPersistentCacheTaskClient interface { Recv() (*DownloadPersistentCacheTaskResponse, error) grpc.ClientStream } type dfdaemonDownloadDownloadPersistentCacheTaskClient struct { grpc.ClientStream } func (x *dfdaemonDownloadDownloadPersistentCacheTaskClient) Recv() (*DownloadPersistentCacheTaskResponse, error) { m := new(DownloadPersistentCacheTaskResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *dfdaemonDownloadClient) UploadPersistentCacheTask(ctx context.Context, in *UploadPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) { out := new(v2.PersistentCacheTask) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) { out := new(v2.PersistentCacheTask) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dfdaemonDownloadClient) DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/DeletePersistentCacheTask", in, out, opts...) if err != nil { return nil, err } return out, nil } // DfdaemonDownloadServer is the server API for DfdaemonDownload service. // All implementations should embed UnimplementedDfdaemonDownloadServer // for forward compatibility type DfdaemonDownloadServer interface { // DownloadTask downloads task from p2p network. DownloadTask(*DownloadTaskRequest, DfdaemonDownload_DownloadTaskServer) error // UploadTask uploads task to p2p network. UploadTask(context.Context, *UploadTaskRequest) (*emptypb.Empty, error) // StatTask stats task information. StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) // DeleteTask deletes task from p2p network. DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) // DeleteHost releases host in scheduler. DeleteHost(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // DownloadPersistentCacheTask downloads persistent cache task from p2p network. DownloadPersistentCacheTask(*DownloadPersistentCacheTaskRequest, DfdaemonDownload_DownloadPersistentCacheTaskServer) error // UploadPersistentCacheTask uploads persistent cache task to p2p network. UploadPersistentCacheTask(context.Context, *UploadPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) // StatPersistentCacheTask stats persistent cache task information. StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) // DeletePersistentCacheTask deletes persistent cache task from p2p network. DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) } // UnimplementedDfdaemonDownloadServer should be embedded to have forward compatible implementations. type UnimplementedDfdaemonDownloadServer struct { } func (UnimplementedDfdaemonDownloadServer) DownloadTask(*DownloadTaskRequest, DfdaemonDownload_DownloadTaskServer) error { return status.Errorf(codes.Unimplemented, "method DownloadTask not implemented") } func (UnimplementedDfdaemonDownloadServer) UploadTask(context.Context, *UploadTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UploadTask not implemented") } func (UnimplementedDfdaemonDownloadServer) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) { return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented") } func (UnimplementedDfdaemonDownloadServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented") } func (UnimplementedDfdaemonDownloadServer) DeleteHost(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteHost not implemented") } func (UnimplementedDfdaemonDownloadServer) DownloadPersistentCacheTask(*DownloadPersistentCacheTaskRequest, DfdaemonDownload_DownloadPersistentCacheTaskServer) error { return status.Errorf(codes.Unimplemented, "method DownloadPersistentCacheTask not implemented") } func (UnimplementedDfdaemonDownloadServer) UploadPersistentCacheTask(context.Context, *UploadPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) { return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTask not implemented") } func (UnimplementedDfdaemonDownloadServer) StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) { return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCacheTask not implemented") } func (UnimplementedDfdaemonDownloadServer) DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCacheTask not implemented") } // UnsafeDfdaemonDownloadServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DfdaemonDownloadServer will // result in compilation errors. type UnsafeDfdaemonDownloadServer interface { mustEmbedUnimplementedDfdaemonDownloadServer() } func RegisterDfdaemonDownloadServer(s grpc.ServiceRegistrar, srv DfdaemonDownloadServer) { s.RegisterService(&DfdaemonDownload_ServiceDesc, srv) } func _DfdaemonDownload_DownloadTask_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(DownloadTaskRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(DfdaemonDownloadServer).DownloadTask(m, &dfdaemonDownloadDownloadTaskServer{stream}) } type DfdaemonDownload_DownloadTaskServer interface { Send(*DownloadTaskResponse) error grpc.ServerStream } type dfdaemonDownloadDownloadTaskServer struct { grpc.ServerStream } func (x *dfdaemonDownloadDownloadTaskServer) Send(m *DownloadTaskResponse) error { return x.ServerStream.SendMsg(m) } func _DfdaemonDownload_UploadTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UploadTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).UploadTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/UploadTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).UploadTask(ctx, req.(*UploadTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_StatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).StatTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/StatTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).StatTask(ctx, req.(*StatTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).DeleteTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/DeleteTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).DeleteTask(ctx, req.(*DeleteTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_DeleteHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).DeleteHost(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/DeleteHost", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).DeleteHost(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_DownloadPersistentCacheTask_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(DownloadPersistentCacheTaskRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(DfdaemonDownloadServer).DownloadPersistentCacheTask(m, &dfdaemonDownloadDownloadPersistentCacheTaskServer{stream}) } type DfdaemonDownload_DownloadPersistentCacheTaskServer interface { Send(*DownloadPersistentCacheTaskResponse) error grpc.ServerStream } type dfdaemonDownloadDownloadPersistentCacheTaskServer struct { grpc.ServerStream } func (x *dfdaemonDownloadDownloadPersistentCacheTaskServer) Send(m *DownloadPersistentCacheTaskResponse) error { return x.ServerStream.SendMsg(m) } func _DfdaemonDownload_UploadPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UploadPersistentCacheTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).UploadPersistentCacheTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).UploadPersistentCacheTask(ctx, req.(*UploadPersistentCacheTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_StatPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatPersistentCacheTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).StatPersistentCacheTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).StatPersistentCacheTask(ctx, req.(*StatPersistentCacheTaskRequest)) } return interceptor(ctx, in, info, handler) } func _DfdaemonDownload_DeletePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeletePersistentCacheTaskRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DfdaemonDownloadServer).DeletePersistentCacheTask(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/dfdaemon.v2.DfdaemonDownload/DeletePersistentCacheTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DfdaemonDownloadServer).DeletePersistentCacheTask(ctx, req.(*DeletePersistentCacheTaskRequest)) } return interceptor(ctx, in, info, handler) } // DfdaemonDownload_ServiceDesc is the grpc.ServiceDesc for DfdaemonDownload service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var DfdaemonDownload_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dfdaemon.v2.DfdaemonDownload", HandlerType: (*DfdaemonDownloadServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "UploadTask", Handler: _DfdaemonDownload_UploadTask_Handler, }, { MethodName: "StatTask", Handler: _DfdaemonDownload_StatTask_Handler, }, { MethodName: "DeleteTask", Handler: _DfdaemonDownload_DeleteTask_Handler, }, { MethodName: "DeleteHost", Handler: _DfdaemonDownload_DeleteHost_Handler, }, { MethodName: "UploadPersistentCacheTask", Handler: _DfdaemonDownload_UploadPersistentCacheTask_Handler, }, { MethodName: "StatPersistentCacheTask", Handler: _DfdaemonDownload_StatPersistentCacheTask_Handler, }, { MethodName: "DeletePersistentCacheTask", Handler: _DfdaemonDownload_DeletePersistentCacheTask_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "DownloadTask", Handler: _DfdaemonDownload_DownloadTask_Handler, ServerStreams: true, }, { StreamName: "DownloadPersistentCacheTask", Handler: _DfdaemonDownload_DownloadPersistentCacheTask_Handler, ServerStreams: true, }, }, Metadata: "pkg/apis/dfdaemon/v2/dfdaemon.proto", }