// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.14.0
// source: github.com/moby/buildkit/session/filesync/filesync.proto

package filesync

import (
	context "context"
	types "github.com/tonistiigi/fsutil/types"
	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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	FileSync_DiffCopy_FullMethodName  = "/moby.filesync.v1.FileSync/DiffCopy"
	FileSync_TarStream_FullMethodName = "/moby.filesync.v1.FileSync/TarStream"
)

// FileSyncClient is the client API for FileSync 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.
//
// FileSync exposes local files from the client to the server.
type FileSyncClient interface {
	DiffCopy(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[types.Packet, types.Packet], error)
	TarStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[types.Packet, types.Packet], error)
}

type fileSyncClient struct {
	cc grpc.ClientConnInterface
}

func NewFileSyncClient(cc grpc.ClientConnInterface) FileSyncClient {
	return &fileSyncClient{cc}
}

func (c *fileSyncClient) DiffCopy(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[types.Packet, types.Packet], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &FileSync_ServiceDesc.Streams[0], FileSync_DiffCopy_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[types.Packet, types.Packet]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSync_DiffCopyClient = grpc.BidiStreamingClient[types.Packet, types.Packet]

func (c *fileSyncClient) TarStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[types.Packet, types.Packet], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &FileSync_ServiceDesc.Streams[1], FileSync_TarStream_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[types.Packet, types.Packet]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSync_TarStreamClient = grpc.BidiStreamingClient[types.Packet, types.Packet]

// FileSyncServer is the server API for FileSync service.
// All implementations should embed UnimplementedFileSyncServer
// for forward compatibility.
//
// FileSync exposes local files from the client to the server.
type FileSyncServer interface {
	DiffCopy(grpc.BidiStreamingServer[types.Packet, types.Packet]) error
	TarStream(grpc.BidiStreamingServer[types.Packet, types.Packet]) error
}

// UnimplementedFileSyncServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedFileSyncServer struct{}

func (UnimplementedFileSyncServer) DiffCopy(grpc.BidiStreamingServer[types.Packet, types.Packet]) error {
	return status.Error(codes.Unimplemented, "method DiffCopy not implemented")
}
func (UnimplementedFileSyncServer) TarStream(grpc.BidiStreamingServer[types.Packet, types.Packet]) error {
	return status.Error(codes.Unimplemented, "method TarStream not implemented")
}
func (UnimplementedFileSyncServer) testEmbeddedByValue() {}

// UnsafeFileSyncServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FileSyncServer will
// result in compilation errors.
type UnsafeFileSyncServer interface {
	mustEmbedUnimplementedFileSyncServer()
}

func RegisterFileSyncServer(s grpc.ServiceRegistrar, srv FileSyncServer) {
	// If the following call panics, it indicates UnimplementedFileSyncServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&FileSync_ServiceDesc, srv)
}

func _FileSync_DiffCopy_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FileSyncServer).DiffCopy(&grpc.GenericServerStream[types.Packet, types.Packet]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSync_DiffCopyServer = grpc.BidiStreamingServer[types.Packet, types.Packet]

func _FileSync_TarStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FileSyncServer).TarStream(&grpc.GenericServerStream[types.Packet, types.Packet]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSync_TarStreamServer = grpc.BidiStreamingServer[types.Packet, types.Packet]

// FileSync_ServiceDesc is the grpc.ServiceDesc for FileSync service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FileSync_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "moby.filesync.v1.FileSync",
	HandlerType: (*FileSyncServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "DiffCopy",
			Handler:       _FileSync_DiffCopy_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "TarStream",
			Handler:       _FileSync_TarStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "github.com/moby/buildkit/session/filesync/filesync.proto",
}

const (
	FileSend_DiffCopy_FullMethodName = "/moby.filesync.v1.FileSend/DiffCopy"
)

// FileSendClient is the client API for FileSend 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.
//
// FileSend allows sending files from the server back to the client.
type FileSendClient interface {
	DiffCopy(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BytesMessage, BytesMessage], error)
}

type fileSendClient struct {
	cc grpc.ClientConnInterface
}

func NewFileSendClient(cc grpc.ClientConnInterface) FileSendClient {
	return &fileSendClient{cc}
}

func (c *fileSendClient) DiffCopy(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BytesMessage, BytesMessage], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &FileSend_ServiceDesc.Streams[0], FileSend_DiffCopy_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[BytesMessage, BytesMessage]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSend_DiffCopyClient = grpc.BidiStreamingClient[BytesMessage, BytesMessage]

// FileSendServer is the server API for FileSend service.
// All implementations should embed UnimplementedFileSendServer
// for forward compatibility.
//
// FileSend allows sending files from the server back to the client.
type FileSendServer interface {
	DiffCopy(grpc.BidiStreamingServer[BytesMessage, BytesMessage]) error
}

// UnimplementedFileSendServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedFileSendServer struct{}

func (UnimplementedFileSendServer) DiffCopy(grpc.BidiStreamingServer[BytesMessage, BytesMessage]) error {
	return status.Error(codes.Unimplemented, "method DiffCopy not implemented")
}
func (UnimplementedFileSendServer) testEmbeddedByValue() {}

// UnsafeFileSendServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FileSendServer will
// result in compilation errors.
type UnsafeFileSendServer interface {
	mustEmbedUnimplementedFileSendServer()
}

func RegisterFileSendServer(s grpc.ServiceRegistrar, srv FileSendServer) {
	// If the following call panics, it indicates UnimplementedFileSendServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&FileSend_ServiceDesc, srv)
}

func _FileSend_DiffCopy_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FileSendServer).DiffCopy(&grpc.GenericServerStream[BytesMessage, BytesMessage]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type FileSend_DiffCopyServer = grpc.BidiStreamingServer[BytesMessage, BytesMessage]

// FileSend_ServiceDesc is the grpc.ServiceDesc for FileSend service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FileSend_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "moby.filesync.v1.FileSend",
	HandlerType: (*FileSendServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "DiffCopy",
			Handler:       _FileSend_DiffCopy_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "github.com/moby/buildkit/session/filesync/filesync.proto",
}
