feat: integration torrent (#30)

This commit is contained in:
monkeyWie authored and GitHub committed 2022-08-11 14:38:16 +08:00
1 parent 43378c7dc8
commit 034137322f
20 files changed
+925 -139

No files matched your search

+2 -1
View File
@@ -5,7 +5,8 @@ import "errors"
type Status int
const (
DownloadStatusReady Status = iota
DownloadStatusPrepare Status = iota
DownloadStatusReady
DownloadStatusStart
DownloadStatusPause
DownloadStatusError
+5 -1
View File
@@ -2,6 +2,8 @@ package base
// 下载请求
type Request struct {
// 下载链接
Schema string
// 下载链接
URL string
// 附加信息
@@ -12,7 +14,7 @@ type Request struct {
type Resource struct {
Req *Request
// 资源总大小
TotalSize int64
Length int64
// 是否支持断点下载
Range bool
// 资源所包含的文件列表
@@ -33,4 +35,6 @@ type Options struct {
Path string
// 并发连接数
Connections int
// 下载的文件下标列表
SelectFiles []int
}