filesync

package
v0.0.0-...-2745715 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

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

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

func (m *BytesMessage) XXX_DiscardUnknown()

func (*BytesMessage) XXX_Marshal

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

func (*BytesMessage) XXX_Merge

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

func (*BytesMessage) XXX_Size

func (m *BytesMessage) XXX_Size() int

func (*BytesMessage) XXX_Unmarshal

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 DirSource

type DirSource interface {
	LookupDir(string) (SyncedDir, 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 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

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

func (InvalidSessionError) Error

func (e InvalidSessionError) Error() string

func (InvalidSessionError) Unwrap

func (e InvalidSessionError) Unwrap() error

type StaticDirSource

type StaticDirSource map[string]SyncedDir

func (StaticDirSource) LookupDir

func (dirs StaticDirSource) LookupDir(name string) (SyncedDir, bool)

type Stream

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

type UnimplementedFileSendServer struct {
}

UnimplementedFileSendServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileSendServer) DiffCopy

type UnimplementedFileSyncServer

type UnimplementedFileSyncServer struct {
}

UnimplementedFileSyncServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileSyncServer) DiffCopy

func (*UnimplementedFileSyncServer) TarStream

Jump to

Keyboard shortcuts

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