downloader

package
v0.0.0-...-62cbee7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 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 Downloader

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

func New

func New(options ...OptionFunc) *Downloader

func (*Downloader) Close

func (dl *Downloader) Close()

func (*Downloader) Send

func (dl *Downloader) Send(di File)

func (*Downloader) Start

func (dl *Downloader) Start()

func (*Downloader) Wait

func (dl *Downloader) Wait()

type File

type File struct {
	URL       string
	LocalPath string
	// contains filtered or unexported fields
}

func NewFile

func NewFile(URL, localPath string) File

func (File) Download

func (fd File) Download(client *http.Client) error

func (File) Exists

func (fd File) Exists() bool

type OptionFunc

type OptionFunc func(*Options)

func WithProxy

func WithProxy(proxyURL string) OptionFunc

func WithThreads

func WithThreads(threads int) OptionFunc

func WithTimeout

func WithTimeout(timeout int) OptionFunc

func WithWarnAsErrorLimit

func WithWarnAsErrorLimit(limit int) OptionFunc

type Options

type Options struct {
	ProxyURL         string
	Timeout          int
	Threads          int
	WarnAsErrorLimit int
}

Jump to

Keyboard shortcuts

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