xmplus

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	APIHost string
	NodeID  int
	Key     string

	LastReportOnline map[int]int

	LocalRuleList []api.DetectRule
	// contains filtered or unexported fields
}

func New

func New(apiConfig *api.Config) *APIClient

func (*APIClient) Debug

func (c *APIClient) Debug()

func (*APIClient) Describe

func (c *APIClient) Describe() api.ClientInfo

func (*APIClient) GetNodeInfo

func (c *APIClient) GetNodeInfo() (nodeInfo *api.NodeInfo, err error)

func (*APIClient) GetNodeRule

func (c *APIClient) GetNodeRule() (*[]api.DetectRule, error)

func (*APIClient) GetRelayNodeInfo

func (c *APIClient) GetRelayNodeInfo() (*api.RelayNodeInfo, error)

func (*APIClient) GetSubscriptionList

func (c *APIClient) GetSubscriptionList() (SubscriptionList *[]api.SubscriptionInfo, err error)

func (*APIClient) ParseSubscriptionList

func (c *APIClient) ParseSubscriptionList(subscriptionResponse *[]Subscription) (*[]api.SubscriptionInfo, error)

func (*APIClient) ReportNodeOnlineIPs

func (c *APIClient) ReportNodeOnlineIPs(onlineSubscriptionList *[]api.OnlineIP) error

func (*APIClient) ReportSubscriptionTraffic

func (c *APIClient) ReportSubscriptionTraffic(subscriptionTraffic *[]api.SubscriptionTraffic) error

type IllegalItem

type IllegalItem struct {
	ID  int `json:"rule_id"`
	UID int `json:"subscription_id"`
}

type OnlineIP

type OnlineIP struct {
	UID int    `json:"subscription_id"`
	IP  string `json:"ip"`
}

OnlineUser is the data structure of online user

type PostData

type PostData struct {
	Data interface{} `json:"data"`
}

PostData is the data structure of post data

type Response

type Response struct {
	Ret  uint            `json:"ret"`
	Data json.RawMessage `json:"data"`
}

Response is the common response

type Subscription

type Subscription struct {
	Id         int    `json:"id"`
	Uuid       string `json:"uuid"`
	Email      string `json:"email"`
	Passwd     string `json:"passwd"`
	Speedlimit int    `json:"speedlimit"`
	Iplimit    int    `json:"iplimit"`
	Ipcount    int    `json:"ipcount"`
}

type SubscriptionResponse

type SubscriptionResponse struct {
	Data json.RawMessage `json:"subscriptions"`
}

SubscriptionResponse is the common response

type SubscriptionTraffic

type SubscriptionTraffic struct {
	UID      int   `json:"subscription_id"`
	Upload   int64 `json:"u"`
	Download int64 `json:"d"`
}

SubscriptionTraffic is the data structure of traffic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL