mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 23:39:46 +08:00
feat: basic aria2 integration
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package tasktype
|
||||
|
||||
//go:generate go-enum --values --names --flag --nocase
|
||||
// ENUM(tgfiles,tphpics,parseditem,directlinks)
|
||||
// ENUM(tgfiles,tphpics,parseditem,directlinks,aria2)
|
||||
type TaskType string
|
||||
|
||||
@@ -20,6 +20,8 @@ const (
|
||||
TaskTypeParseditem TaskType = "parseditem"
|
||||
// TaskTypeDirectlinks is a TaskType of type directlinks.
|
||||
TaskTypeDirectlinks TaskType = "directlinks"
|
||||
// TaskTypeAria2 is a TaskType of type aria2.
|
||||
TaskTypeAria2 TaskType = "aria2"
|
||||
)
|
||||
|
||||
var ErrInvalidTaskType = fmt.Errorf("not a valid TaskType, try [%s]", strings.Join(_TaskTypeNames, ", "))
|
||||
@@ -29,6 +31,7 @@ var _TaskTypeNames = []string{
|
||||
string(TaskTypeTphpics),
|
||||
string(TaskTypeParseditem),
|
||||
string(TaskTypeDirectlinks),
|
||||
string(TaskTypeAria2),
|
||||
}
|
||||
|
||||
// TaskTypeNames returns a list of possible string values of TaskType.
|
||||
@@ -45,6 +48,7 @@ func TaskTypeValues() []TaskType {
|
||||
TaskTypeTphpics,
|
||||
TaskTypeParseditem,
|
||||
TaskTypeDirectlinks,
|
||||
TaskTypeAria2,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +69,7 @@ var _TaskTypeValue = map[string]TaskType{
|
||||
"tphpics": TaskTypeTphpics,
|
||||
"parseditem": TaskTypeParseditem,
|
||||
"directlinks": TaskTypeDirectlinks,
|
||||
"aria2": TaskTypeAria2,
|
||||
}
|
||||
|
||||
// ParseTaskType attempts to convert a string to a TaskType.
|
||||
|
||||
@@ -45,6 +45,8 @@ type Add struct {
|
||||
ParsedItem *parser.Item
|
||||
// directlinks
|
||||
DirectLinks []string
|
||||
// aria2
|
||||
Aria2URIs []string
|
||||
}
|
||||
|
||||
type SetDefaultStorage struct {
|
||||
|
||||
Reference in New Issue
Block a user