filesync

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 25 Imported by: 225

Documentation

Index

Constants

View Source
const (
	FileSync_DiffCopy_FullMethodName  = "/moby.filesync.v1.FileSync/DiffCopy"
	FileSync_TarStream_FullMethodName = "/moby.filesync.v1.FileSync/TarStream"
)
View Source
const (
	FileSend_DiffCopy_FullMethodName = "/moby.filesync.v1.FileSend/DiffCopy"
)

Variables

View Source
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",
}

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)

View Source
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",
}

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)

View Source
var File_github_com_moby_buildkit_session_filesync_filesync_proto protoreflect.FileDescriptor

Functions

func CopyFileWriter

func CopyFileWriter(ctx context.Context, md map[string]string, id int, c session.Caller) (io.WriteCloser, error)

func CopyToCaller

func CopyToCaller(ctx context.Context, fs fsutil.FS, id int, c session.Caller, progress func(int, bool)) error

func FSSync

func FSSync(ctx context.Context, c session.Caller, opt FSSendRequestOpt) error

FSSync initializes a transfer of files

func NewFSSyncProvider

func NewFSSyncProvider(dirs DirSource) session.Attachable

NewFSSyncProvider creates a new provider for sending files from client

func NewFSSyncTarget

func NewFSSyncTarget(targets ...FSSyncTarget) session.Attachable

func RegisterFileSendServer

func RegisterFileSendServer(s grpc.ServiceRegistrar, srv FileSendServer)

func RegisterFileSyncServer

func RegisterFileSyncServer(s grpc.ServiceRegistrar, srv FileSyncServer)

Types

type BytesMessage

type BytesMessage struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

BytesMessage contains a chunk of byte data

func (*BytesMessage) CloneMessageVT added in v0.17.0

func (m *BytesMessage) CloneMessageVT() proto.Message

func (*BytesMessage) CloneVT added in v0.17.0

func (m *BytesMessage) CloneVT() *BytesMessage

func (*BytesMessage) Descriptor deprecated

func (*BytesMessage) Descriptor() ([]byte, []int)

Deprecated: Use BytesMessage.ProtoReflect.Descriptor instead.

func (*BytesMessage) EqualMessageVT added in v0.17.0

func (this *BytesMessage) EqualMessageVT(thatMsg proto.Message) bool

func (*BytesMessage) EqualVT added in v0.17.0

func (this *BytesMessage) EqualVT(that *BytesMessage) bool

func (*BytesMessage) GetData

func (x *BytesMessage) GetData() []byte

func (*BytesMessage) MarshalToSizedBufferVT added in v0.17.0

func (m *BytesMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*BytesMessage) MarshalToVT added in v0.17.0

func (m *BytesMessage) MarshalToVT(dAtA []byte) (int, error)

func (*BytesMessage) MarshalVT added in v0.17.0

func (m *BytesMessage) MarshalVT() (dAtA []byte, err error)

func (*BytesMessage) ProtoMessage

func (*BytesMessage) ProtoMessage()

func (*BytesMessage) ProtoReflect added in v0.17.0

func (x *BytesMessage) ProtoReflect() protoreflect.Message

func (*BytesMessage) Reset

func (x *BytesMessage) Reset()

func (*BytesMessage) SizeVT added in v0.17.0

func (m *BytesMessage) SizeVT() (n int)

func (*BytesMessage) String

func (x *BytesMessage) String() string

func (*BytesMessage) UnmarshalVT added in v0.17.0

func (m *BytesMessage) UnmarshalVT(dAtA []byte) error

type CacheUpdater

type CacheUpdater interface {
	MarkSupported(bool)
	HandleChange(fsutil.ChangeKind, string, os.FileInfo, error) error
	ContentHasher() fsutil.ContentHasher
}

CacheUpdater is an object capable of sending notifications for the cache hash changes

type DirSource added in v0.11.0

type DirSource interface {
	LookupDir(string) (fsutil.FS, bool)
}

type FSSendRequestOpt

type FSSendRequestOpt struct {
	Name            string
	IncludePatterns []string
	ExcludePatterns []string
	FollowPaths     []string
	DestDir         string
	CacheUpdater    CacheUpdater
	ProgressCb      func(int, bool)
	Filter          func(string, *fstypes.Stat) bool
	Differ          fsutil.DiffType
}

FSSendRequestOpt defines options for FSSend request

type FSSyncTarget added in v0.13.0

type FSSyncTarget interface {
	// contains filtered or unexported methods
}

func WithFSSync added in v0.13.0

func WithFSSync(id int, f FileOutputFunc) FSSyncTarget

func WithFSSyncDir added in v0.13.0

func WithFSSyncDir(id int, outdir string) FSSyncTarget

type FileOutputFunc added in v0.13.0

type FileOutputFunc func(map[string]string) (io.WriteCloser, error)

type FileSendClient

type FileSendClient interface {
	DiffCopy(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BytesMessage, BytesMessage], error)
}

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.

func NewFileSendClient

func NewFileSendClient(cc grpc.ClientConnInterface) FileSendClient

type FileSendServer

type FileSendServer interface {
	DiffCopy(grpc.BidiStreamingServer[BytesMessage, BytesMessage]) error
}

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 FileSend_DiffCopyClient

type FileSend_DiffCopyClient = grpc.BidiStreamingClient[BytesMessage, BytesMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FileSend_DiffCopyServer

type FileSend_DiffCopyServer = grpc.BidiStreamingServer[BytesMessage, BytesMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FileSyncClient

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

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.

func NewFileSyncClient

func NewFileSyncClient(cc grpc.ClientConnInterface) FileSyncClient

type FileSyncServer

type FileSyncServer interface {
	DiffCopy(grpc.BidiStreamingServer[types.Packet, types.Packet]) error
	TarStream(grpc.BidiStreamingServer[types.Packet, types.Packet]) error
}

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 FileSync_DiffCopyClient

type FileSync_DiffCopyClient = grpc.BidiStreamingClient[types.Packet, types.Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FileSync_DiffCopyServer

type FileSync_DiffCopyServer = grpc.BidiStreamingServer[types.Packet, types.Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FileSync_TarStreamClient

type FileSync_TarStreamClient = grpc.BidiStreamingClient[types.Packet, types.Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FileSync_TarStreamServer

type FileSync_TarStreamServer = grpc.BidiStreamingServer[types.Packet, types.Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type InvalidSessionError added in v0.10.0

type InvalidSessionError struct {
	// contains filtered or unexported fields
}

func (InvalidSessionError) Error added in v0.10.0

func (e InvalidSessionError) Error() string

func (InvalidSessionError) Unwrap added in v0.10.0

func (e InvalidSessionError) Unwrap() error

type StaticDirSource added in v0.11.0

type StaticDirSource map[string]fsutil.FS

func (StaticDirSource) LookupDir added in v0.11.0

func (dirs StaticDirSource) LookupDir(name string) (fsutil.FS, bool)

type Stream added in v0.8.0

type Stream interface {
	Context() context.Context
	SendMsg(m interface{}) error
	RecvMsg(m interface{}) error
}

type SyncedDir

type SyncedDir struct {
	Dir string
	Map func(string, *fstypes.Stat) fsutil.MapResult
}

type UnimplementedFileSendServer added in v0.7.0

type UnimplementedFileSendServer struct{}

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.

func (UnimplementedFileSendServer) DiffCopy added in v0.7.0

type UnimplementedFileSyncServer added in v0.7.0

type UnimplementedFileSyncServer struct{}

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.

func (UnimplementedFileSyncServer) DiffCopy added in v0.7.0

func (UnimplementedFileSyncServer) TarStream added in v0.7.0

type UnsafeFileSendServer added in v0.17.0

type UnsafeFileSendServer interface {
	// contains filtered or unexported methods
}

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 UnsafeFileSyncServer added in v0.17.0

type UnsafeFileSyncServer interface {
	// contains filtered or unexported methods
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL