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) GetRelayNodeInfo() (*api.RelayNodeInfo, error)
- func (c *APIClient) GetUserList() (UserList *[]api.UserInfo, err error)
- func (c *APIClient) ParseUserListResponse(userInfoResponse *[]User) (*[]api.UserInfo, error)
- func (c *APIClient) ReportNodeOnlineIPs(onlineIP *[]api.OnlineIP) error
- func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error
- type IllegalItem
- type OnlineIP
- type PostData
- type Response
- type User
- 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
LastReportOnline map[int]int
LocalRuleList []api.DetectRule
// contains filtered or unexported fields
}
func (*APIClient) Describe ¶
func (c *APIClient) Describe() api.ClientInfo
func (*APIClient) GetNodeInfo ¶
func (*APIClient) GetNodeRule ¶
func (c *APIClient) GetNodeRule() (*[]api.DetectRule, error)
func (*APIClient) GetRelayNodeInfo ¶
func (c *APIClient) GetRelayNodeInfo() (*api.RelayNodeInfo, error)
func (*APIClient) GetUserList ¶
func (*APIClient) ParseUserListResponse ¶
func (*APIClient) ReportNodeOnlineIPs ¶
func (*APIClient) ReportUserTraffic ¶
func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error
type IllegalItem ¶
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 UserResponse ¶
type UserResponse struct {
Data json.RawMessage `json:"users"`
}
Response is the common response
type UserTraffic ¶
type UserTraffic struct {
UID int `json:"userid"`
Upload int64 `json:"u"`
Download int64 `json:"d"`
}
UserTraffic is the data structure of traffic
Click to show internal directories.
Click to hide internal directories.