feat: extension on start event (#239)

This commit is contained in:
Levi authored and GitHub committed 2023-10-19 18:08:27 +08:00
1 parent 755d7ce814
commit 858ad74339
23 files changed
+292 -101

No files matched your search

+9 -1
View File
@@ -9,6 +9,15 @@ import (
type Request struct {
URL string `json:"url"`
Extra any `json:"extra"`
// Labels is used to mark the download task
Labels map[string]string `json:"labels"`
}
func (r *Request) Validate() error {
if r.URL == "" {
return fmt.Errorf("invalid request url")
}
return nil
}
// Resource download resource
@@ -36,7 +45,6 @@ func (r *Resource) Validate() error {
}
}
return nil
}
func (r *Resource) CalcSize() {