change project structure, fix online ip report bug

This commit is contained in:
yuzuki999
2022-08-16 13:04:33 +08:00
parent ca180a63c9
commit 27b97927c1
41 changed files with 121 additions and 152 deletions

View File

@@ -1,7 +1,7 @@
// Package api contains all the api used by XrayR
// To implement an api , one needs to implement the interface below.
package api
package panel
import (
"github.com/Yuzuki616/V2bX/conf"
@@ -12,7 +12,7 @@ import (
"time"
)
// API is the interface for different panel's api.
// Panel is the interface for different panel's api.
type ClientInfo struct {
APIHost string
@@ -39,7 +39,7 @@ type Client struct {
NodeRuleRspMd5 [16]byte
}
func New(apiConfig *conf.ApiConfig) API {
func New(apiConfig *conf.ApiConfig) Panel {
client := resty.New()
client.SetRetryCount(3)
if apiConfig.Timeout > 0 {

View File

@@ -1,4 +1,4 @@
package api
package panel
import (
"bufio"

View File

@@ -1,6 +1,6 @@
package api
package panel
type API interface {
type Panel interface {
GetNodeInfo() (nodeInfo *NodeInfo, err error)
GetUserList() (userList []UserInfo, err error)
ReportUserTraffic(userTraffic []UserTraffic) (err error)

View File

@@ -1,4 +1,4 @@
package api
package panel
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package api
package panel
import (
"fmt"