download

package
v0.0.0-...-9dc5689 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTorrent = "torrent"
	TypeHTTP    = "http"
)

Variables

This section is empty.

Functions

func NewTorrentDownloader

func NewTorrentDownloader(repo *storage.MediaRepository) *torrentDownloader

Types

type Getter

type Getter interface {
	Get(item media.SearchItem, url string, destination string) (Informer, error)
}

type HttpDownloader

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

func NewHttpDownloader

func NewHttpDownloader() *HttpDownloader

func (*HttpDownloader) Get

func (d *HttpDownloader) Get(item media.SearchItem, url string, destination string) (Informer, error)

type Info

type Info struct {
	Item            media.SearchItem
	Filepath        string
	TotalBytes      int64
	DownloadedBytes int64
	IsDone          bool
	Error           error
	Url             string
}

func (*Info) Progress

func (f *Info) Progress() float64

Progress returns the progress of the file from 0 to 1

func (*Info) ProgressBytes

func (f *Info) ProgressBytes() string

Progress returns the progress of the file from 0 to 1

type Informer

type Informer interface {
	Info() *Info
}

Jump to

Keyboard shortcuts

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