downloader

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aria2

type Aria2 struct {

	// Allow to set a custom HTTP transport (for test purposes)
	CustomTransport http.RoundTripper
	// contains filtered or unexported fields
}

Aria2 is a downloader interface for aria2 see https://aria2.github.io/manual/en/html/aria2c.html#methods for more infos

func (*Aria2) Auth

func (ad *Aria2) Auth(infos map[string]interface{}) error

Auth initializes the Aria2

func (*Aria2) Download

func (ad *Aria2) Download(uri string, options map[string]interface{}) (string, error)

Download starts the download of a given uri

func (*Aria2) DownloadStatus

func (ad *Aria2) DownloadStatus(downloadID string) (map[string]interface{}, error)

DownloadStatus returns some status infos about the download

type Downloader

type Downloader interface {
	Auth(infos map[string]interface{}) error
	Download(uri string, options map[string]interface{}) (string, error)
	DownloadStatus(downloadID string) (map[string]interface{}, error)
}

Downloader takes uri and download them

func NewDownloader

func NewDownloader(name string, authInfos map[string]interface{}) (Downloader, error)

NewDownloader returns a new authenticated downloader

Jump to

Keyboard shortcuts

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