Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDownloader = &Downloader{
ThreadCount: 10,
SegmentSize: 1024 * 1024 * 2,
}
Functions ¶
func DestroyCoroutinePool ¶
func DestroyCoroutinePool(pool *CoroutinePool)
Types ¶
type CoroutinePool ¶
type CoroutinePool struct {
// contains filtered or unexported fields
}
func CreateCoroutinePool ¶
func CreateCoroutinePool(coroutineCount int, handler PoolHandler) *CoroutinePool
func (*CoroutinePool) AddTask ¶
func (pool *CoroutinePool) AddTask(data interface{})
func (*CoroutinePool) Wait ¶
func (pool *CoroutinePool) Wait()
type Downloader ¶
type Downloader struct { Url string ThreadCount int RealThreadCount int FilePath string ContentLength int64 Speed float32 SegmentSize int64 Proxies string // contains filtered or unexported fields }
func (*Downloader) Download ¶
func (downloader *Downloader) Download(url, filepath string) error
func (*Downloader) ShowDownloadSpeed ¶
func (downloader *Downloader) ShowDownloadSpeed()
type PoolHandler ¶
type PoolHandler func(interface{})
Click to show internal directories.
Click to hide internal directories.