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, error)
- func (c *APIClient) GetTransitNodeInfo() (transitnodeinfo *api.TransitNodeInfo, err error)
- func (c *APIClient) GetUserList() (UserList *[]api.UserInfo, err error)
- func (c *APIClient) ParseNodeResponse(nodeInfoResponse *NodeInfoResponse) (*api.NodeInfo, error)
- func (c *APIClient) ParseTransitNodeResponse(nodeInfoResponse *TransitNodeInfoResponse) (*api.TransitNodeInfo, error)
- func (c *APIClient) ParseUserListResponse(userInfoResponse *[]UserResponse) (*[]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 IllegalItem
- type NodeInfoResponse
- type OnlineUser
- type PostData
- type Response
- type RuleItem
- type SystemLoad
- type TransitNodeInfoResponse
- type UserResponse
- type UserTraffic
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
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 xmanager
func (*APIClient) GetNodeRule ¶
func (c *APIClient) GetNodeRule() (*[]api.DetectRule, error)
GetNodeRule will pull the audit rule form sspanel
func (*APIClient) GetTransitNodeInfo ¶
func (c *APIClient) GetTransitNodeInfo() (transitnodeinfo *api.TransitNodeInfo, err error)
GetNodeInfo will pull GetTransitNodeInfo Config from xmanager
func (*APIClient) GetUserList ¶
GetUserList will pull user form xmanager
func (*APIClient) ParseNodeResponse ¶
func (c *APIClient) ParseNodeResponse(nodeInfoResponse *NodeInfoResponse) (*api.NodeInfo, error)
func (*APIClient) ParseTransitNodeResponse ¶
func (c *APIClient) ParseTransitNodeResponse(nodeInfoResponse *TransitNodeInfoResponse) (*api.TransitNodeInfo, error)
func (*APIClient) ParseUserListResponse ¶
func (c *APIClient) ParseUserListResponse(userInfoResponse *[]UserResponse) (*[]api.UserInfo, error)
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 xmanager
func (*APIClient) ReportUserTraffic ¶
func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error
ReportUserTraffic reports the user traffic
type IllegalItem ¶
type NodeInfoResponse ¶
type NodeInfoResponse struct {
SpeedLimit float64 `json:"speedlimit"`
Method string `json:"method"`
Port uint32 `json:"port"`
Address string `json:"server"`
Type string `json:"type"`
Security string `json:"security"`
Host string `json:"host"`
Path string `json:"path"`
Headertype string `json:"header"`
Protocol string `json:"protocol"`
AllowInsecure bool `json:"allowinsecure"`
RelayNodeID int `json:"relayid"`
ListenIP string `json:"listenip"`
ProxyProtocol bool `json:"proxyprotocol"`
Sniffing bool `json:"sniffing"`
ServiceName string `json:"servicename"`
Fingerprint string `json:"tlsfingerprint"`
RejectUnknownSNI bool `json:"rejectunknownsni"`
Quic_security string `json:"quic_security"`
Quic_key string `json:"quic_key"`
}
NodeInfoResponse is the response of node
type OnlineUser ¶
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 SystemLoad ¶
SystemLoad is the data structure of systemload
type TransitNodeInfoResponse ¶
type TransitNodeInfoResponse struct {
SpeedLimit float64 `json:"speedlimit"`
Method string `json:"method"`
Port uint32 `json:"port"`
Address string `json:"server"`
Type string `json:"type"`
Security string `json:"security"`
Host string `json:"host"`
Path string `json:"path"`
Headertype string `json:"header"`
Protocol string `json:"protocol"`
AllowInsecure bool `json:"allowinsecure"`
NodeID int `json:"relayid"`
ListenIP string `json:"listenip"`
ProxyProtocol bool `json:"proxyprotocol"`
Sniffing bool `json:"sniffing"`
ServiceName string `json:"servicename"`
Flow string `json:"flow"`
Fingerprint string `json:"tlsfingerprint"`
RejectUnknownSNI bool `json:"rejectunknownsni"`
Quic_security string `json:"quic_security"`
Quic_key string `json:"quic_key"`
}
type UserResponse ¶
type UserResponse struct {
ID int `json:"id"`
Email string `json:"email"`
Passwd string `json:"passwd"`
SpeedLimit float64 `json:"speedlimit"`
DeviceLimit int `json:"iplimit"`
UUID string `json:"uuid"`
IPcount int `json:"ip_count"`
LimitType int `json:"limit_type"`
}
UserResponse is the response of user
type UserTraffic ¶
type UserTraffic struct {
UID int `json:"user_id"`
Upload int64 `json:"u"`
Download int64 `json:"d"`
}
UserTraffic is the data structure of traffic