core

package
v0.0.0-...-d9687f3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: BSD-2-Clause Imports: 10 Imported by: 0

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{})

Jump to

Keyboard shortcuts

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