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) GetSubscriptionList() (SubscriptionList *[]api.SubscriptionInfo, err error)
- func (c *APIClient) ParseSubscriptionList(subscriptionResponse *[]Subscription) (*[]api.SubscriptionInfo, error)
- func (c *APIClient) ReportNodeOnlineIPs(onlineSubscriptionList *[]api.OnlineIP) error
- func (c *APIClient) ReportSubscriptionTraffic(subscriptionTraffic *[]api.SubscriptionTraffic) error
- type IllegalItem
- type OnlineIP
- type PostData
- type Response
- type Subscription
- type SubscriptionResponse
- type SubscriptionTraffic
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) GetSubscriptionList ¶
func (c *APIClient) GetSubscriptionList() (SubscriptionList *[]api.SubscriptionInfo, err error)
func (*APIClient) ParseSubscriptionList ¶
func (c *APIClient) ParseSubscriptionList(subscriptionResponse *[]Subscription) (*[]api.SubscriptionInfo, error)
func (*APIClient) ReportNodeOnlineIPs ¶
func (*APIClient) ReportSubscriptionTraffic ¶
func (c *APIClient) ReportSubscriptionTraffic(subscriptionTraffic *[]api.SubscriptionTraffic) 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 Subscription ¶
type SubscriptionResponse ¶
type SubscriptionResponse struct {
Data json.RawMessage `json:"subscriptions"`
}
SubscriptionResponse is the common response
type SubscriptionTraffic ¶
type SubscriptionTraffic struct {
UID int `json:"subscription_id"`
Upload int64 `json:"u"`
Download int64 `json:"d"`
}
SubscriptionTraffic is the data structure of traffic
Click to show internal directories.
Click to hide internal directories.