Documentation ¶
Index ¶
- type DownloadClent
- func (d *DownloadClent) AverageBytesPerSecond() uint64
- func (d *DownloadClent) BytesTransferred() int64
- func (d *DownloadClent) FileName() string
- func (d *DownloadClent) GetAsync(dst, src string) (*grab.Response, error)
- func (d *DownloadClent) IsRunning() bool
- func (d *DownloadClent) Size() int64
- func (d *DownloadClent) Stop()
- type DownloadMgr
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadClent ¶
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) Start ¶
func (d *DownloadMgr) Start()
func (*DownloadMgr) Stop ¶
func (d *DownloadMgr) Stop(id int) error
func (*DownloadMgr) Tasks ¶
func (d *DownloadMgr) Tasks() []*Task
Click to show internal directories.
Click to hide internal directories.