Documentation ¶
Index ¶
- type APIClient
- func (c *APIClient) Debug()
- func (c *APIClient) Describe() api.ClientInfo
- func (c *APIClient) GetNodeInfo() (nodeInfo *api.NodeInfo, err error)
- func (c *APIClient) GetNodeRule() (*[]api.DetectRule, *[]string, error)
- func (c *APIClient) GetUserList() (UserList *[]api.UserInfo, err error)
- func (c *APIClient) ParseSSNodeResponse(nodeInfoResponse *json.RawMessage) (*api.NodeInfo, error)
- func (c *APIClient) ParseSSUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
- func (c *APIClient) ParseTrojanNodeResponse(nodeInfoResponse *json.RawMessage) (*api.NodeInfo, error)
- func (c *APIClient) ParseTrojanUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
- func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *json.RawMessage) (*api.NodeInfo, error)
- func (c *APIClient) ParseV2rayUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
- func (c *APIClient) ReportIllegal(detectResultList *[]api.DetectResult) error
- func (c *APIClient) ReportNodeOnlineUsers(onlineUserList *[]api.OnlineUser) error
- func (c *APIClient) ReportNodeStatus(nodeStatus *api.NodeStatus) (err error)
- func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error
- type Certificate
- type IllegalReport
- type NodeOnline
- type NodeRule
- type NodeRuleItem
- type NodeStatus
- type Response
- type SSUser
- type ShadowsocksNodeInfo
- type TrojanNodeInfo
- type TrojanUser
- type UserTraffic
- type V2rayNodeInfo
- type VMessUser
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 a api client to the panel.
func (*APIClient) Describe ¶
func (c *APIClient) Describe() api.ClientInfo
Describe return a description of the client
func (*APIClient) GetNodeInfo ¶
GetNodeInfo will pull NodeInfo Config from sspanel
func (*APIClient) GetNodeRule ¶
func (c *APIClient) GetNodeRule() (*[]api.DetectRule, *[]string, error)
GetNodeRule will pull the audit rule form sspanel
func (*APIClient) GetUserList ¶
GetUserList will pull user form sspanel
func (*APIClient) ParseSSNodeResponse ¶
ParseSSNodeResponse parse the response for the given nodeinfor format
func (*APIClient) ParseSSUserListResponse ¶
func (c *APIClient) ParseSSUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
ParseSSUserListResponse parse the response for the given userinfo format
func (*APIClient) ParseTrojanNodeResponse ¶
func (c *APIClient) ParseTrojanNodeResponse(nodeInfoResponse *json.RawMessage) (*api.NodeInfo, error)
ParseTrojanNodeResponse parse the response for the given nodeinfor format
func (*APIClient) ParseTrojanUserListResponse ¶
func (c *APIClient) ParseTrojanUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
ParseTrojanUserListResponse parse the response for the given userinfo format
func (*APIClient) ParseV2rayNodeResponse ¶
func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *json.RawMessage) (*api.NodeInfo, error)
ParseV2rayNodeResponse parse the response for the given nodeinfor format
func (*APIClient) ParseV2rayUserListResponse ¶
func (c *APIClient) ParseV2rayUserListResponse(userInfoResponse *json.RawMessage) (*[]api.UserInfo, error)
ParseV2rayUserListResponse parse the response for the given userinfo format
func (*APIClient) ReportIllegal ¶
func (c *APIClient) ReportIllegal(detectResultList *[]api.DetectResult) error
ReportIllegal reports the user illegal behaviors
func (*APIClient) ReportNodeOnlineUsers ¶
func (c *APIClient) ReportNodeOnlineUsers(onlineUserList *[]api.OnlineUser) error
ReportNodeOnlineUsers reports online user ip
func (*APIClient) ReportNodeStatus ¶
func (c *APIClient) ReportNodeStatus(nodeStatus *api.NodeStatus) (err error)
ReportNodeStatus reports the node status to the sspanel
func (*APIClient) ReportUserTraffic ¶
func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error
ReportUserTraffic reports the user traffic
type Certificate ¶
type IllegalReport ¶
type IllegalReport struct { UID int `json:"uid"` RuleID int `json:"rule_id"` Reason string `json:"reason"` }
IllegalReport
type NodeOnline ¶
type NodeRule ¶
type NodeRule struct { Mode string `json:"mode"` Rules []NodeRuleItem `json:"rules"` }
type NodeRuleItem ¶
type NodeStatus ¶
type NodeStatus struct { CPU string `json:"cpu"` Mem string `json:"mem"` Net string `json:"net"` Disk string `json:"disk"` Uptime int `json:"uptime"` }
Node status report
type Response ¶
type Response struct { Status string `json:"status"` Code int `json:"code"` Data json.RawMessage `json:"data"` Message string `json:"message"` }
type ShadowsocksNodeInfo ¶
type TrojanNodeInfo ¶
type TrojanUser ¶
type UserTraffic ¶
type V2rayNodeInfo ¶
type V2rayNodeInfo struct { ID int `json:"id"` IsUDP bool `json:"is_udp"` SpeedLimit uint64 `json:"speed_limit"` ClientLimit int `json:"client_limit"` PushPort int `json:"push_port"` Secret string `json:"secret"` Key string `json:"key"` Cert string `json:"pem"` V2License string `json:"v2_license"` V2AlterID int `json:"v2_alter_id"` V2Port int `json:"v2_port"` V2Method string `json:"v2_method"` V2Net string `json:"v2_net"` V2Type string `json:"v2_type"` V2Host string `json:"v2_host"` V2Path string `json:"v2_path"` V2TLS bool `json:"v2_tls"` V2Cdn bool `json:"v2_cdn"` V2TLSProvider string `json:"v2_tls_provider"` RedirectUrl string `json:"redirect_url"` }