download

package
v0.0.0-...-2403d1f Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadClent

type DownloadClent struct {
	Error error
	Src   string
	// contains filtered or unexported fields
}

func (*DownloadClent) AverageBytesPerSecond

func (d *DownloadClent) AverageBytesPerSecond() uint64

func (*DownloadClent) BytesTransferred

func (d *DownloadClent) BytesTransferred() int64

func (*DownloadClent) FileName

func (d *DownloadClent) FileName() string

func (*DownloadClent) GetAsync

func (d *DownloadClent) GetAsync(dst, src string) (*grab.Response, error)

GetAsync sends a file transfer request and returns a channel to receive the file transfer response context.

The Response is sent via the returned channel and the channel closed as soon as the HTTP/1.1 GET request has been served; before the file transfer begins.

The Response may then be used to monitor the progress of the file transfer while it is in process.

Any error which occurs during the file transfer will be set in the returned Response.Error field as soon as the Response.IsComplete method returns true.

GetAsync is a wrapper for DefaultClient.DoAsync.

func (*DownloadClent) IsRunning

func (d *DownloadClent) IsRunning() bool

func (*DownloadClent) Size

func (d *DownloadClent) Size() int64

func (*DownloadClent) Stop

func (d *DownloadClent) Stop()

type DownloadMgr

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

func NewDownloadMgr

func NewDownloadMgr() *DownloadMgr

func (*DownloadMgr) Download

func (d *DownloadMgr) Download(url string) (int, error)

func (*DownloadMgr) Start

func (d *DownloadMgr) Start()

func (*DownloadMgr) Stop

func (d *DownloadMgr) Stop(id int) error

func (*DownloadMgr) Tasks

func (d *DownloadMgr) Tasks() []*Task

type Task

type Task struct {
	Size                  int64
	BytesTransferred      int64
	AverageBytesPerSecond uint64
	Src                   string
	Dest                  string
	Id                    int
}

Jump to

Keyboard shortcuts

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