chore: aria2 notifier

This commit is contained in:
Noah Hsu
2022-06-20 22:29:52 +08:00
parent 6c552a9d62
commit 1b3387ca1a
10 changed files with 92 additions and 29 deletions

View File

@ -9,10 +9,11 @@ import (
)
var Aria2TaskManager = task.NewTaskManager()
var notify = NewNotify()
var client rpc.Client
func InitAria2Client(uri string, secret string, timeout int) error {
c, err := rpc.New(context.Background(), uri, secret, time.Duration(timeout)*time.Second, &Notify{})
c, err := rpc.New(context.Background(), uri, secret, time.Duration(timeout)*time.Second, notify)
if err != nil {
return errors.Wrap(err, "failed to init aria2 client")
}