// 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)
	// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
	UpdatePersistentCacheTask(ctx context.Context, in *UpdatePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, 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)
	// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
	SyncPersistentCachePieces(ctx context.Context, in *SyncPersistentCachePiecesRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncPersistentCachePiecesClient, error)
	// DownloadPersistentCachePiece downloads persistent cache piece from the remote peer.
	DownloadPersistentCachePiece(ctx context.Context, in *DownloadPersistentCachePieceRequest, opts ...grpc.CallOption) (*DownloadPersistentCachePieceResponse, error)
	// SyncHost sync host info from parents.
	SyncHost(ctx context.Context, in *SyncHostRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncHostClient, error)
	// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
	ExchangeIBVerbsQueuePairEndpoint(ctx context.Context, in *ExchangeIBVerbsQueuePairEndpointRequest, opts ...grpc.CallOption) (*ExchangeIBVerbsQueuePairEndpointResponse, 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) UpdatePersistentCacheTask(ctx context.Context, in *UpdatePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, 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
}

func (c *dfdaemonUploadClient) SyncPersistentCachePieces(ctx context.Context, in *SyncPersistentCachePiecesRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncPersistentCachePiecesClient, error) {
	stream, err := c.cc.NewStream(ctx, &DfdaemonUpload_ServiceDesc.Streams[3], "/dfdaemon.v2.DfdaemonUpload/SyncPersistentCachePieces", opts...)
	if err != nil {
		return nil, err
	}
	x := &dfdaemonUploadSyncPersistentCachePiecesClient{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_SyncPersistentCachePiecesClient interface {
	Recv() (*SyncPersistentCachePiecesResponse, error)
	grpc.ClientStream
}

type dfdaemonUploadSyncPersistentCachePiecesClient struct {
	grpc.ClientStream
}

func (x *dfdaemonUploadSyncPersistentCachePiecesClient) Recv() (*SyncPersistentCachePiecesResponse, error) {
	m := new(SyncPersistentCachePiecesResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *dfdaemonUploadClient) DownloadPersistentCachePiece(ctx context.Context, in *DownloadPersistentCachePieceRequest, opts ...grpc.CallOption) (*DownloadPersistentCachePieceResponse, error) {
	out := new(DownloadPersistentCachePieceResponse)
	err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCachePiece", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dfdaemonUploadClient) SyncHost(ctx context.Context, in *SyncHostRequest, opts ...grpc.CallOption) (DfdaemonUpload_SyncHostClient, error) {
	stream, err := c.cc.NewStream(ctx, &DfdaemonUpload_ServiceDesc.Streams[4], "/dfdaemon.v2.DfdaemonUpload/SyncHost", opts...)
	if err != nil {
		return nil, err
	}
	x := &dfdaemonUploadSyncHostClient{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_SyncHostClient interface {
	Recv() (*v2.Host, error)
	grpc.ClientStream
}

type dfdaemonUploadSyncHostClient struct {
	grpc.ClientStream
}

func (x *dfdaemonUploadSyncHostClient) Recv() (*v2.Host, error) {
	m := new(v2.Host)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *dfdaemonUploadClient) ExchangeIBVerbsQueuePairEndpoint(ctx context.Context, in *ExchangeIBVerbsQueuePairEndpointRequest, opts ...grpc.CallOption) (*ExchangeIBVerbsQueuePairEndpointResponse, error) {
	out := new(ExchangeIBVerbsQueuePairEndpointResponse)
	err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonUpload/ExchangeIBVerbsQueuePairEndpoint", 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
	// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
	UpdatePersistentCacheTask(context.Context, *UpdatePersistentCacheTaskRequest) (*emptypb.Empty, 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)
	// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
	SyncPersistentCachePieces(*SyncPersistentCachePiecesRequest, DfdaemonUpload_SyncPersistentCachePiecesServer) error
	// DownloadPersistentCachePiece downloads persistent cache piece from the remote peer.
	DownloadPersistentCachePiece(context.Context, *DownloadPersistentCachePieceRequest) (*DownloadPersistentCachePieceResponse, error)
	// SyncHost sync host info from parents.
	SyncHost(*SyncHostRequest, DfdaemonUpload_SyncHostServer) error
	// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
	ExchangeIBVerbsQueuePairEndpoint(context.Context, *ExchangeIBVerbsQueuePairEndpointRequest) (*ExchangeIBVerbsQueuePairEndpointResponse, 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) UpdatePersistentCacheTask(context.Context, *UpdatePersistentCacheTaskRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdatePersistentCacheTask 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")
}
func (UnimplementedDfdaemonUploadServer) SyncPersistentCachePieces(*SyncPersistentCachePiecesRequest, DfdaemonUpload_SyncPersistentCachePiecesServer) error {
	return status.Errorf(codes.Unimplemented, "method SyncPersistentCachePieces not implemented")
}
func (UnimplementedDfdaemonUploadServer) DownloadPersistentCachePiece(context.Context, *DownloadPersistentCachePieceRequest) (*DownloadPersistentCachePieceResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DownloadPersistentCachePiece not implemented")
}
func (UnimplementedDfdaemonUploadServer) SyncHost(*SyncHostRequest, DfdaemonUpload_SyncHostServer) error {
	return status.Errorf(codes.Unimplemented, "method SyncHost not implemented")
}
func (UnimplementedDfdaemonUploadServer) ExchangeIBVerbsQueuePairEndpoint(context.Context, *ExchangeIBVerbsQueuePairEndpointRequest) (*ExchangeIBVerbsQueuePairEndpointResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ExchangeIBVerbsQueuePairEndpoint 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_UpdatePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdatePersistentCacheTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DfdaemonUploadServer).UpdatePersistentCacheTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DfdaemonUploadServer).UpdatePersistentCacheTask(ctx, req.(*UpdatePersistentCacheTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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)
}

func _DfdaemonUpload_SyncPersistentCachePieces_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(SyncPersistentCachePiecesRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DfdaemonUploadServer).SyncPersistentCachePieces(m, &dfdaemonUploadSyncPersistentCachePiecesServer{stream})
}

type DfdaemonUpload_SyncPersistentCachePiecesServer interface {
	Send(*SyncPersistentCachePiecesResponse) error
	grpc.ServerStream
}

type dfdaemonUploadSyncPersistentCachePiecesServer struct {
	grpc.ServerStream
}

func (x *dfdaemonUploadSyncPersistentCachePiecesServer) Send(m *SyncPersistentCachePiecesResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _DfdaemonUpload_DownloadPersistentCachePiece_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DownloadPersistentCachePieceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DfdaemonUploadServer).DownloadPersistentCachePiece(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCachePiece",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DfdaemonUploadServer).DownloadPersistentCachePiece(ctx, req.(*DownloadPersistentCachePieceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DfdaemonUpload_SyncHost_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(SyncHostRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DfdaemonUploadServer).SyncHost(m, &dfdaemonUploadSyncHostServer{stream})
}

type DfdaemonUpload_SyncHostServer interface {
	Send(*v2.Host) error
	grpc.ServerStream
}

type dfdaemonUploadSyncHostServer struct {
	grpc.ServerStream
}

func (x *dfdaemonUploadSyncHostServer) Send(m *v2.Host) error {
	return x.ServerStream.SendMsg(m)
}

func _DfdaemonUpload_ExchangeIBVerbsQueuePairEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExchangeIBVerbsQueuePairEndpointRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DfdaemonUploadServer).ExchangeIBVerbsQueuePairEndpoint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/dfdaemon.v2.DfdaemonUpload/ExchangeIBVerbsQueuePairEndpoint",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DfdaemonUploadServer).ExchangeIBVerbsQueuePairEndpoint(ctx, req.(*ExchangeIBVerbsQueuePairEndpointRequest))
	}
	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: "UpdatePersistentCacheTask",
			Handler:    _DfdaemonUpload_UpdatePersistentCacheTask_Handler,
		},
		{
			MethodName: "StatPersistentCacheTask",
			Handler:    _DfdaemonUpload_StatPersistentCacheTask_Handler,
		},
		{
			MethodName: "DeletePersistentCacheTask",
			Handler:    _DfdaemonUpload_DeletePersistentCacheTask_Handler,
		},
		{
			MethodName: "DownloadPersistentCachePiece",
			Handler:    _DfdaemonUpload_DownloadPersistentCachePiece_Handler,
		},
		{
			MethodName: "ExchangeIBVerbsQueuePairEndpoint",
			Handler:    _DfdaemonUpload_ExchangeIBVerbsQueuePairEndpoint_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,
		},
		{
			StreamName:    "SyncPersistentCachePieces",
			Handler:       _DfdaemonUpload_SyncPersistentCachePieces_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SyncHost",
			Handler:       _DfdaemonUpload_SyncHost_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)
	// StatTask stats task information.
	StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error)
	// ListTaskEntries lists task entries for downloading directory.
	ListTaskEntries(ctx context.Context, in *ListTaskEntriesRequest, opts ...grpc.CallOption) (*ListTaskEntriesResponse, 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)
}

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) 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) ListTaskEntries(ctx context.Context, in *ListTaskEntriesRequest, opts ...grpc.CallOption) (*ListTaskEntriesResponse, error) {
	out := new(ListTaskEntriesResponse)
	err := c.cc.Invoke(ctx, "/dfdaemon.v2.DfdaemonDownload/ListTaskEntries", 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
}

// 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
	// StatTask stats task information.
	StatTask(context.Context, *StatTaskRequest) (*v2.Task, error)
	// ListTaskEntries lists task entries for downloading directory.
	ListTaskEntries(context.Context, *ListTaskEntriesRequest) (*ListTaskEntriesResponse, 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)
}

// 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) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented")
}
func (UnimplementedDfdaemonDownloadServer) ListTaskEntries(context.Context, *ListTaskEntriesRequest) (*ListTaskEntriesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListTaskEntries 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")
}

// 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_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_ListTaskEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListTaskEntriesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DfdaemonDownloadServer).ListTaskEntries(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/dfdaemon.v2.DfdaemonDownload/ListTaskEntries",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DfdaemonDownloadServer).ListTaskEntries(ctx, req.(*ListTaskEntriesRequest))
	}
	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)
}

// 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: "StatTask",
			Handler:    _DfdaemonDownload_StatTask_Handler,
		},
		{
			MethodName: "ListTaskEntries",
			Handler:    _DfdaemonDownload_ListTaskEntries_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,
		},
	},
	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",
}
