transfer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src backend.Backend, srcPath string, dst backend.Backend, dstPath string, send func(tea.Msg)) error

CopyFile copies a single file from src backend to dst backend with progress reporting.

func FormatProgress

func FormatProgress(p ProgressMsg) string

FormatProgress returns a human-readable progress string.

func ListRecursive

func ListRecursive(b backend.Backend, path string) ([]backend.FileEntry, error)

ListRecursive lists all files (non-directory entries) under path recursively.

func MoveFile

func MoveFile(b backend.Backend, src, dst string, send func(tea.Msg)) error

MoveFile moves a file within the same backend. Uses server-side copy if available.

func RunPool

func RunPool(ctx context.Context, src, dst backend.Backend, jobs []CopyJob, concurrency int, send func(tea.Msg)) error

RunPool copies files concurrently using a worker pool. It forwards transfer progress messages via send. The first error cancels all remaining work.

Types

type CopyJob

type CopyJob struct {
	Src       string
	Dst       string
	Size      int64
	FileIndex int // 1-based index
}

CopyJob describes a single file copy operation.

type DoneMsg

type DoneMsg struct {
	Err error
}

DoneMsg is sent when the entire transfer operation completes.

type ProgressMsg

type ProgressMsg struct {
	Name       string
	BytesDone  int64
	BytesTotal int64
	Done       bool
	Err        error
}

ProgressMsg is sent to the Bubble Tea program to report transfer progress.

Jump to

Keyboard shortcuts

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