downloader

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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 Downloader

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

func New

func New(url, filePath, sha256Sum string, opts ...Option) *Downloader

func (*Downloader) Errors

func (d *Downloader) Errors() <-chan error

func (*Downloader) FileName

func (d *Downloader) FileName() string

func (*Downloader) FileType

func (d *Downloader) FileType() string

func (*Downloader) Start

func (d *Downloader) Start(ctx context.Context)

func (*Downloader) Stats

func (d *Downloader) Stats() <-chan Stats

type Error added in v1.5.0

type Error struct {
	Message string
	Reason  error
}

func (*Error) Error added in v1.5.0

func (e *Error) Error() string

func (*Error) Unwrap added in v1.5.0

func (e *Error) Unwrap() error

type Option

type Option func(*options)

func WithCustomClient

func WithCustomClient(client *http.Client) Option

type Stats

type Stats struct {
	Downloaded int64
	TotalSize  int64
	Percent    float64
	Completed  bool
}

Jump to

Keyboard shortcuts

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