Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader uploads local files to the target storage via a worker pool. If a file changes while being uploaded, it is re-uploaded once after the current upload finishes, instead of being queued multiple times.
func NewUploader ¶
func NewUploader(ctx context.Context, opts UploaderOptions) *Uploader
NewUploader creates and starts an Uploader. The caller must call Close when done.
type UploaderOptions ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches a local directory and submits stable files to the Uploader.
Write-completion detection: fsnotify emits Write events throughout a write. Watcher debounces per file and only uploads once the file size stays unchanged across a debounce window, avoiding uploads of partial files.
func NewWatcher ¶
func NewWatcher(ctx context.Context, opts WatcherOptions) (*Watcher, error)
NewWatcher creates a Watcher.
func (*Watcher) ScanExisting ¶
ScanExisting triggers a one-time scan and upload of existing files under the watch root.