v2board

package
v0.0.0-...-1ce56db Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MPL-2.0 Imports: 11 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
	NodeType      string
	EnableVless   bool
	EnableXTLS    bool
	SpeedLimit    float64
	DeviceLimit   int
	LocalRuleList []api.DetectRule
	// contains filtered or unexported fields
}

APIClient create an api client to the panel.

func New

func New(apiConfig *api.Config) *APIClient

New create an api instance

func (*APIClient) Debug

func (c *APIClient) Debug()

Debug set the client debug for client

func (*APIClient) Describe

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

Describe return a description of the client

func (*APIClient) GetNodeInfo

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

GetNodeInfo will pull NodeInfo Config from sspanel

func (*APIClient) GetNodeRule

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

GetNodeRule implements the API interface

func (*APIClient) GetUserList

func (c *APIClient) GetUserList() (UserList *[]api.UserInfo, err error)

GetUserList will pull user form sspanel

func (*APIClient) ParseSSNodeResponse

func (c *APIClient) ParseSSNodeResponse() (*api.NodeInfo, error)

ParseSSNodeResponse parse the response for the given nodeinfor format

func (*APIClient) ParseTrojanNodeResponse

func (c *APIClient) ParseTrojanNodeResponse(nodeInfoResponse *simplejson.Json) (*api.NodeInfo, error)

ParseTrojanNodeResponse parse the response for the given nodeinfor format

func (*APIClient) ParseV2rayNodeResponse

func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (*api.NodeInfo, error)

ParseV2rayNodeResponse parse the response for the given nodeinfor format

func (*APIClient) ReportIllegal

func (c *APIClient) ReportIllegal(detectResultList *[]api.DetectResult) error

ReportIllegal implements the API interface

func (*APIClient) ReportNodeOnlineUsers

func (c *APIClient) ReportNodeOnlineUsers(onlineUserList *[]api.OnlineUser) error

ReportNodeOnlineUsers implements the API interface

func (*APIClient) ReportNodeStatus

func (c *APIClient) ReportNodeStatus(nodeStatus *api.NodeStatus) (err error)

ReportNodeStatus implements the API interface

func (*APIClient) ReportUserTraffic

func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error

ReportUserTraffic reports the user traffic

type UserTraffic

type UserTraffic struct {
	UID      int   `json:"user_id"`
	Upload   int64 `json:"u"`
	Download int64 `json:"d"`
}

Jump to

Keyboard shortcuts

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