V2bX/api/panel/node_test.go

37 lines
597 B
Go
Raw Normal View History

package panel
import (
"github.com/Yuzuki616/V2bX/conf"
"github.com/Yuzuki616/V2bX/node/controller/legoCmd/log"
"testing"
)
2022-12-22 12:52:44 -05:00
var client Panel
func init() {
c, err := New(&conf.ApiConfig{
APIHost: "http://127.0.0.1",
Key: "token",
NodeType: "V2ray",
NodeID: 1,
})
if err != nil {
2022-12-22 12:52:44 -05:00
log.Panic(err)
}
2022-12-22 12:52:44 -05:00
client = c
}
func TestClient_GetNodeInfo(t *testing.T) {
log.Println(client.GetNodeInfo())
}
func TestClient_ReportUserTraffic(t *testing.T) {
log.Println(client.ReportUserTraffic([]UserTraffic{
{
UID: 10372,
Upload: 1000,
Download: 1000,
},
}))
}