flashget

package
v0.0.0-...-04eb9d5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_DOWNLOADING = "downloading"
	STATUS_SUCCESS     = "success"
	STATUS_FAILURE     = "failure"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadManager

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

DownloadManager manager all Downloaders

func NewDownloadManager

func NewDownloadManager() *DownloadManager

func (*DownloadManager) Downloads

func (dm *DownloadManager) Downloads() []*Downloader

func (*DownloadManager) EnableAutoRecycle

func (dm *DownloadManager) EnableAutoRecycle()

func (*DownloadManager) FinishedDownloads

func (dm *DownloadManager) FinishedDownloads() []*Downloader

FinishedDownloads Ordered by FinishedAt

func (*DownloadManager) Recycle

func (dm *DownloadManager) Recycle()

Recycle to free spaces

func (*DownloadManager) Remove

func (dm *DownloadManager) Remove(url string) bool

Remove download from manager

func (*DownloadManager) Retrive

func (dm *DownloadManager) Retrive(url string) (dl *Downloader, err error)

Retrive url as local file

type Downloader

type Downloader struct {
	Filename      string    `json:"filename"`
	ContentLength int64     `json:"contentLength"`
	Status        string    `json:"status"`
	Description   string    `json:"description"`
	URL           string    `json:"url"`
	CreatedAt     time.Time `json:"createdAt"`
	FinishedAt    time.Time `json:"finishedAt"`
	AccessedAt    time.Time `json:"accessedAt"` // TODO(ssx): need to use some times
	// contains filtered or unexported fields
}

func (*Downloader) Finished

func (dl *Downloader) Finished() bool

func (*Downloader) HumanSpeed

func (dl *Downloader) HumanSpeed() string

func (*Downloader) Remove

func (dl *Downloader) Remove() bool

Remove downloaded file

func (*Downloader) Wait

func (dl *Downloader) Wait()

func (*Downloader) Written

func (dl *Downloader) Written() int64

type ProxyWriter

type ProxyWriter struct {
	W io.Writer
	// contains filtered or unexported fields
}

ProxyWriter record download bytes

func NewProxyWriter

func NewProxyWriter(wr io.Writer) *ProxyWriter

func (*ProxyWriter) HumanSpeed

func (p *ProxyWriter) HumanSpeed() string

func (*ProxyWriter) Write

func (p *ProxyWriter) Write(data []byte) (n int, err error)

func (*ProxyWriter) Written

func (p *ProxyWriter) Written() int

Jump to

Keyboard shortcuts

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