Feat: validate / cancel task while downloading file in aria2

This commit is contained in:
HFO4
2020-02-05 12:58:26 +08:00
parent 8c7e3883ee
commit 3ed84ad5ec
7 changed files with 119 additions and 4 deletions

View File

@@ -40,6 +40,12 @@ func (client *RPCService) Status(task *model.Download) (rpc.StatusInfo, error) {
return client.caller.TellStatus(task.GID)
}
// Cancel 取消下载
func (client *RPCService) Cancel(task *model.Download) error {
_, err := client.caller.Remove(task.GID)
return err
}
// CreateTask 创建新任务
func (client *RPCService) CreateTask(task *model.Download) error {
// 生成存储路径