Documentation ¶
Index ¶
- func DownloadFile(urls, file string, threadCount int)
- func DownloadFileDefault(urls, folders string, threadCount int)
- func GetBytesFile(filename string, bufferSize int) []byte
- func SafeMkdir(folder string)
- func TestDownload(urlStr string, perThreadSize int) (int, map[int]string, []string, string, error)
- func Version()
- type DownloadFileParams
- type DownloadTask
- type DownloadThreadController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
DownloadFile 下载文件并自定义保存文件路径
func DownloadFileDefault ¶
DownloadFileDefault 下载文件并使用URL最后一组作为文件名,例如http://qq/QQ9.6.2.exe则使用QQ9.6.2.exe
func GetBytesFile ¶
func TestDownload ¶
Types ¶
type DownloadFileParams ¶
type DownloadTask ¶
type DownloadTask struct {
// contains filtered or unexported fields
}
type DownloadThreadController ¶
type DownloadThreadController struct { TaskQueue chan DownloadTask // 用于接收下载任务 TaskCount chan int // 用于记载当前任务数量 Exit chan int // 用于记载当前任务数量 ThreadCount int // 最大协程数 WaitGroup sync.WaitGroup // 等待协程完成 RangeStrs map[int]string // 所有需要下载的文件名 FileUrl string // 下载链接 DownloadResultInfoChan chan DownloadFileParams // 下载任务响应通道 DownloadFolder string // 下载文件保存文件夹 DownloadFileName string // 下载文件保存文件名 Filenames []string // 子文件名,有序 }
func (*DownloadThreadController) Init ¶
func (controller *DownloadThreadController) Init()
func (*DownloadThreadController) Run ¶
func (controller *DownloadThreadController) Run()
Click to show internal directories.
Click to hide internal directories.