mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +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
+11
-8
@@ -6,15 +6,17 @@ import (
|
||||
"github.com/monkeyWie/gopeed-core/pkg/base"
|
||||
"github.com/monkeyWie/gopeed-core/pkg/util"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
ID string
|
||||
Res *base.Resource
|
||||
Opts *base.Options
|
||||
Status base.Status
|
||||
Files map[string]*base.FileInfo
|
||||
Progress *Progress
|
||||
ID string `json:"id"`
|
||||
Res *base.Resource `json:"res"`
|
||||
Opts *base.Options `json:"opts"`
|
||||
Status base.Status `json:"status"`
|
||||
Files map[string]*base.FileInfo `json:"files"`
|
||||
Progress *Progress `json:"progress"`
|
||||
CreateTime time.Time `json:"create_time"`
|
||||
|
||||
fetcher fetcher.Fetcher
|
||||
timer *util.Timer
|
||||
@@ -23,7 +25,8 @@ type Task struct {
|
||||
|
||||
func NewTask() *Task {
|
||||
return &Task{
|
||||
ID: uuid.New().String(),
|
||||
Status: base.DownloadStatusPrepare,
|
||||
ID: uuid.New().String(),
|
||||
Status: base.DownloadStatusReady,
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user