filesync

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 21 Imported by: 226

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthFilesync        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFilesync          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFilesync = fmt.Errorf("proto: unexpected end of group")
)

Functions

func CopyFileWriter

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

func CopyToCaller

func CopyToCaller(ctx context.Context, fs fsutil.FS, 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 []SyncedDir) session.Attachable

NewFSSyncProvider creates a new provider for sending files from client

func NewFSSyncTarget

func NewFSSyncTarget(f func(map[string]string) (io.WriteCloser, error)) session.Attachable

NewFSSyncTarget allows writing into an io.WriteCloser

func NewFSSyncTargetDir

func NewFSSyncTargetDir(outdir string) session.Attachable

NewFSSyncTargetDir allows writing into a directory

func RegisterFileSendServer

func RegisterFileSendServer(s *grpc.Server, srv FileSendServer)

func RegisterFileSyncServer

func RegisterFileSyncServer(s *grpc.Server, srv FileSyncServer)

Types

type BytesMessage

type BytesMessage struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

BytesMessage contains a chunk of byte data

func (*BytesMessage) Descriptor

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

func (*BytesMessage) Equal

func (this *BytesMessage) Equal(that interface{}) bool

func (*BytesMessage) GetData

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

func (*BytesMessage) GoString

func (this *BytesMessage) GoString() string

func (*BytesMessage) Marshal

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

func (*BytesMessage) MarshalTo

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

func (*BytesMessage) MarshalToSizedBuffer added in v0.7.0

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

func (*BytesMessage) ProtoMessage

func (*BytesMessage) ProtoMessage()

func (*BytesMessage) Reset

func (m *BytesMessage) Reset()

func (*BytesMessage) Size

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

func (*BytesMessage) String

func (this *BytesMessage) String() string

func (*BytesMessage) Unmarshal

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

func (*BytesMessage) XXX_DiscardUnknown added in v0.4.0

func (m *BytesMessage) XXX_DiscardUnknown()

func (*BytesMessage) XXX_Marshal added in v0.4.0

func (m *BytesMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BytesMessage) XXX_Merge added in v0.4.0

func (m *BytesMessage) XXX_Merge(src proto.Message)

func (*BytesMessage) XXX_Size added in v0.4.0

func (m *BytesMessage) XXX_Size() int

func (*BytesMessage) XXX_Unmarshal added in v0.4.0

func (m *BytesMessage) XXX_Unmarshal(b []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 FSSendRequestOpt

type FSSendRequestOpt struct {
	Name             string
	IncludePatterns  []string
	ExcludePatterns  []string
	FollowPaths      []string
	OverrideExcludes bool // deprecated: this is used by docker/cli for automatically loading .dockerignore from the directory
	DestDir          string
	CacheUpdater     CacheUpdater
	ProgressCb       func(int, bool)
	Filter           func(string, *fstypes.Stat) bool
	Differ           fsutil.DiffType
}

FSSendRequestOpt defines options for FSSend request

type FileSendClient

type FileSendClient interface {
	DiffCopy(ctx context.Context, opts ...grpc.CallOption) (FileSend_DiffCopyClient, error)
}

FileSendClient is the client API for FileSend service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileSendClient

func NewFileSendClient(cc *grpc.ClientConn) FileSendClient

type FileSendServer

type FileSendServer interface {
	DiffCopy(FileSend_DiffCopyServer) error
}

FileSendServer is the server API for FileSend service.

type FileSend_DiffCopyClient

type FileSend_DiffCopyClient interface {
	Send(*BytesMessage) error
	Recv() (*BytesMessage, error)
	grpc.ClientStream
}

type FileSend_DiffCopyServer

type FileSend_DiffCopyServer interface {
	Send(*BytesMessage) error
	Recv() (*BytesMessage, error)
	grpc.ServerStream
}

type FileSyncClient

type FileSyncClient interface {
	DiffCopy(ctx context.Context, opts ...grpc.CallOption) (FileSync_DiffCopyClient, error)
	TarStream(ctx context.Context, opts ...grpc.CallOption) (FileSync_TarStreamClient, error)
}

FileSyncClient is the client API for FileSync service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileSyncClient

func NewFileSyncClient(cc *grpc.ClientConn) FileSyncClient

type FileSyncServer

type FileSyncServer interface {
	DiffCopy(FileSync_DiffCopyServer) error
	TarStream(FileSync_TarStreamServer) error
}

FileSyncServer is the server API for FileSync service.

type FileSync_DiffCopyClient

type FileSync_DiffCopyClient interface {
	Send(*types.Packet) error
	Recv() (*types.Packet, error)
	grpc.ClientStream
}

type FileSync_DiffCopyServer

type FileSync_DiffCopyServer interface {
	Send(*types.Packet) error
	Recv() (*types.Packet, error)
	grpc.ServerStream
}

type FileSync_TarStreamClient

type FileSync_TarStreamClient interface {
	Send(*types.Packet) error
	Recv() (*types.Packet, error)
	grpc.ClientStream
}

type FileSync_TarStreamServer

type FileSync_TarStreamServer interface {
	Send(*types.Packet) error
	Recv() (*types.Packet, error)
	grpc.ServerStream
}

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 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 {
	Name     string
	Dir      string
	Excludes []string
	Map      func(string, *fstypes.Stat) bool
}

type UnimplementedFileSendServer added in v0.7.0

type UnimplementedFileSendServer struct {
}

UnimplementedFileSendServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileSendServer) DiffCopy added in v0.7.0

type UnimplementedFileSyncServer added in v0.7.0

type UnimplementedFileSyncServer struct {
}

UnimplementedFileSyncServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileSyncServer) DiffCopy added in v0.7.0

func (*UnimplementedFileSyncServer) TarStream added in v0.7.0

Jump to

Keyboard shortcuts

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