xmplus

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 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) GetServiceList

func (c *APIClient) GetServiceList() (ServiceList *[]api.ServiceInfo, err error)

func (*APIClient) ParseServiceList added in v1.0.9

func (c *APIClient) ParseServiceList(serviceResponse *[]Service) (*[]api.ServiceInfo, error)

func (*APIClient) ReportNodeOnlineIPs

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

func (*APIClient) ReportServiceTraffic

func (c *APIClient) ReportServiceTraffic(serviceTraffic *[]api.ServiceTraffic) error

type IllegalItem

type IllegalItem struct {
	ID  int `json:"list_id"`
	UID int `json:"serviceid"`
}

type OnlineIP

type OnlineIP struct {
	UID int    `json:"serviceid"`
	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 Service

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

type ServiceResponse added in v1.0.9

type ServiceResponse struct {
	Data json.RawMessage `json:"services"`
}

ServiceResponse is the common response

type ServiceTraffic

type ServiceTraffic struct {
	UID      int   `json:"serviceid"`
	Upload   int64 `json:"u"`
	Download int64 `json:"d"`
}

UserTraffic is the data structure of traffic

Jump to

Keyboard shortcuts

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