transfer

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package transfer provides byte progress and concurrency for network transfers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	Reader   io.Reader
	Name     string
	Total    int64
	Offset   int64
	Progress tui.Progress
	// contains filtered or unexported fields
}

Reader reports bytes read at a bounded interval.

func (*Reader) Read

func (r *Reader) Read(buffer []byte) (int, error)

Read implements io.Reader and emits byte progress.

func (*Reader) Seek

func (r *Reader) Seek(offset int64, whence int) (int64, error)

Seek rewinds seekable inputs for retries without double-counting progress.

type Transport

type Transport struct {
	Base     http.RoundTripper
	Name     string
	Progress tui.Progress
	// contains filtered or unexported fields
}

Transport aggregates successful HTTP response bodies into one download item.

func (*Transport) Bytes

func (t *Transport) Bytes() (int64, int64)

Bytes returns the aggregate bytes read and expected by the transport.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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