Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDestinationIsDir = errors.New("cannot overwrite a directory with a file")
ErrDestinationIsDir mirrors cp's "cannot overwrite directory with non-directory". The commit step must check for it explicitly: the SFTP rename fallback removes the target first, which deletes an empty directory, and raw `mv -f` moves the temp file inside a directory and still exits 0.
View Source
var ErrParentSource = errors.New("recursive source must not end in '..'")
Functions ¶
func ValidateRecursiveSource ¶ added in v0.5.0
ValidateRecursiveSource lets the CLI reject a ".." source before it connects. Both separators count because the remote OS is not known yet.
Types ¶
type DestinationNotDirError ¶ added in v0.5.0
type DestinationNotDirError struct{ Path string }
func (*DestinationNotDirError) Error ¶ added in v0.5.0
func (e *DestinationNotDirError) Error() string
type Engine ¶
type Engine interface {
Upload(ctx context.Context, localPath, remotePath string, progress ProgressFunc) (*Result, error)
Download(ctx context.Context, remotePath, localPath string, progress ProgressFunc) (*Result, error)
UploadRecursive(ctx context.Context, localDir, remoteDir string, progress ProgressFunc) (*Result, error)
DownloadRecursive(ctx context.Context, remoteDir, localDir string, progress ProgressFunc) (*Result, error)
Stat(ctx context.Context, remotePath string) (PathKind, error)
ResolveDestination(ctx context.Context, remoteDst, name string) (string, error)
PrepareRecursiveDestination(ctx context.Context, remoteDst, name string) (string, error)
ListFiles(ctx context.Context, remoteDir string) ([]string, error)
OpenRead(ctx context.Context, remotePath string) (io.ReadCloser, int64, error)
OpenWrite(ctx context.Context, remotePath string) (io.WriteCloser, func() error, func(), error)
Close() error
Name() string
}
type EngineOption ¶ added in v0.3.0
type EngineOption func(*engineOptions)
func WithMkdirs ¶ added in v0.3.0
func WithMkdirs() EngineOption
type ParsedArgs ¶
func ParseArgs ¶
func ParseArgs(src, dst string) (ParsedArgs, error)
type ProgressFunc ¶
type ProgressFunc func(info ProgressInfo)
type ProgressInfo ¶
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
func NewProgressTracker ¶
func NewProgressTracker(file string, total int64, callback ProgressFunc) *ProgressTracker
func (*ProgressTracker) Finish ¶
func (t *ProgressTracker) Finish()
func (*ProgressTracker) Update ¶
func (t *ProgressTracker) Update(n int)
type RemoteParentMissingError ¶ added in v0.3.0
type RemoteParentMissingError struct {
Path string
}
func (*RemoteParentMissingError) Error ¶ added in v0.3.0
func (e *RemoteParentMissingError) Error() string
Click to show internal directories.
Click to hide internal directories.