chore: add aria2 rpc package

This commit is contained in:
Noah Hsu
2022-06-15 17:15:22 +08:00
parent c65a9b3001
commit 2cddd3cf2b
13 changed files with 1723 additions and 5 deletions

View File

@ -0,0 +1,23 @@
package rpc
import (
"context"
"testing"
"time"
)
func TestWebsocketCaller(t *testing.T) {
time.Sleep(time.Second)
c, err := newWebsocketCaller(context.Background(), "ws://localhost:6800/jsonrpc", time.Second, &DummyNotifier{})
if err != nil {
t.Fatal(err.Error())
}
defer c.Close()
var info VersionInfo
if err := c.Call(aria2GetVersion, []interface{}{}, &info); err != nil {
t.Error(err.Error())
} else {
println(info.Version)
}
}