httpdownloader

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpDownloader

type HttpDownloader struct {
	HttpClient   *http.Client
	Headers      http.Header
	ConBlockChan chan struct{}
	BlockSize    int
	RetryCnt     int
}

func (*HttpDownloader) Download

func (t *HttpDownloader) Download(ctx context.Context, url string, header http.Header, savePath string) error

type HttpFileOffsetWriter

type HttpFileOffsetWriter struct {
	// contains filtered or unexported fields
}

HttpFileOffsetWriter is a writer that writes data to a file at a given file offset.

func NewOffsetWriter

func NewOffsetWriter(file *os.File, mutex *sync.Mutex, offset, end int64) *HttpFileOffsetWriter

NewOffsetWriter creates a new FileOffsetWriter instance to write at the given offset to the file.

func (*HttpFileOffsetWriter) ResetOffset

func (w *HttpFileOffsetWriter) ResetOffset()

func (*HttpFileOffsetWriter) Write

func (w *HttpFileOffsetWriter) Write(p []byte) (n int, err error)

Write writes data to the file at the given offset.

Jump to

Keyboard shortcuts

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