single

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SingleDownloader

type SingleDownloader struct {
	Client       *http.Client
	ProgressChan chan<- any           // Channel for events (start/complete/error)
	ID           string               // Download ID
	State        *types.ProgressState // Shared state for TUI polling
	Runtime      *types.RuntimeConfig
	Headers      map[string]string // Custom HTTP headers (cookies, auth, etc.)
}

SingleDownloader handles single-threaded downloads for servers that don't support range requests. NOTE: Pause/resume is NOT supported because this downloader is only used when the server doesn't support Range headers. If interrupted, the download must restart.

func NewSingleDownloader

func NewSingleDownloader(id string, progressCh chan<- any, state *types.ProgressState, runtime *types.RuntimeConfig) *SingleDownloader

NewSingleDownloader creates a new single-threaded downloader with all required parameters

func (*SingleDownloader) Download

func (d *SingleDownloader) Download(ctx context.Context, rawurl, destPath string, fileSize int64, filename string) (err error)

Download downloads a file using a single connection. This is used for servers that don't support Range requests. If interrupted, the download cannot be resumed and must restart from the beginning.

Jump to

Keyboard shortcuts

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