mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 21:03:41 +00:00
feat: support RESTful api (#33)
This commit is contained in:
1 parent
e292926697
commit
c6aa83194f
22 files changed
+603
-125
No files matched your search
+14
-16
@@ -3,38 +3,36 @@ package base
|
||||
// 下载请求
|
||||
type Request struct {
|
||||
// 下载链接
|
||||
Schema string
|
||||
// 下载链接
|
||||
URL string
|
||||
URL string `json:"url"`
|
||||
// 附加信息
|
||||
Extra interface{}
|
||||
Extra interface{} `json:"extra"`
|
||||
}
|
||||
|
||||
// 资源信息
|
||||
type Resource struct {
|
||||
Req *Request
|
||||
Req *Request `json:"req"`
|
||||
// 资源总大小
|
||||
Length int64
|
||||
Size int64 `json:"size"`
|
||||
// 是否支持断点下载
|
||||
Range bool
|
||||
Range bool `json:"range"`
|
||||
// 资源所包含的文件列表
|
||||
Files []*FileInfo
|
||||
Files []*FileInfo `json:"files"`
|
||||
}
|
||||
|
||||
type FileInfo struct {
|
||||
Name string
|
||||
Path string
|
||||
Size int64
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
||||
// 下载选项
|
||||
type Options struct {
|
||||
// 保存文件名
|
||||
Name string
|
||||
Name string `json:"name"`
|
||||
// 保存目录
|
||||
Path string
|
||||
Path string `json:"path"`
|
||||
// 并发连接数
|
||||
Connections int
|
||||
// 下载的文件下标列表
|
||||
SelectFiles []int
|
||||
Connections int `json:"connections"`
|
||||
// 选择下载的文件下标列表
|
||||
SelectFiles []int `json:"select_files"`
|
||||
}
|
||||
Reference in new issue
Block a user