mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 16:40:32 +00:00
30 lines
553 B
Go
30 lines
553 B
Go
package download
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"github.com/monkeyWie/gopeed-core/internal/fetcher"
|
|
"github.com/monkeyWie/gopeed-core/pkg/base"
|
|
"github.com/monkeyWie/gopeed-core/pkg/util"
|
|
"sync"
|
|
)
|
|
|
|
type Task struct {
|
|
ID string
|
|
Res *base.Resource
|
|
Opts *base.Options
|
|
Status base.Status
|
|
Files map[string]*base.FileInfo
|
|
Progress *Progress
|
|
|
|
fetcher fetcher.Fetcher
|
|
timer *util.Timer
|
|
locker *sync.Mutex
|
|
}
|
|
|
|
func NewTask() *Task {
|
|
return &Task{
|
|
ID: uuid.New().String(),
|
|
Status: base.DownloadStatusPrepare,
|
|
}
|
|
}
|