Documentation
¶
Index ¶
- type API
- type Client
- func (c *Client) Debug()
- func (c *Client) Describe() ClientInfo
- func (c *Client) GetNodeInfo() (nodeInfo *NodeInfo, err error)
- func (c *Client) GetNodeRule() (*[]DetectRule, *[]string, error)
- func (c *Client) GetUserList() (UserList *[]UserInfo, err error)
- func (c *Client) ParseSSNodeResponse() (*NodeInfo, error)
- func (c *Client) ParseTrojanNodeResponse(body []byte) (*NodeInfo, error)
- func (c *Client) ParseV2rayNodeResponse(body []byte, notParseNode, parseRule bool) (*NodeInfo, error)
- func (c *Client) ReportUserTraffic(userTraffic *[]UserTraffic) error
- type ClientInfo
- type Config
- type DetectResult
- type DetectRule
- type NodeInfo
- type OnlineUser
- type Rule
- type SSConfig
- type TrojanConfig
- type TrojanUserInfo
- type UserInfo
- type UserListBody
- type UserTraffic
- type V2RayUserInfo
- type V2rayConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
GetNodeInfo() (nodeInfo *NodeInfo, err error)
GetUserList() (userList *[]UserInfo, err error)
ReportUserTraffic(userTraffic *[]UserTraffic) (err error)
Describe() ClientInfo
GetNodeRule() (ruleList *[]DetectRule, protocolList *[]string, err error)
Debug()
}
type Client ¶
type Client struct {
APIHost string
NodeID int
Key string
NodeType string
//EnableSS2022 bool
EnableVless bool
EnableXTLS bool
SpeedLimit float64
DeviceLimit int
LocalRuleList []DetectRule
RemoteRuleCache *[]Rule
NodeInfoRspMd5 [16]byte
NodeRuleRspMd5 [16]byte
// contains filtered or unexported fields
}
func (*Client) Describe ¶
func (c *Client) Describe() ClientInfo
Describe return a description of the client
func (*Client) GetNodeInfo ¶
GetNodeInfo will pull NodeInfo Config from sspanel
func (*Client) GetNodeRule ¶
func (c *Client) GetNodeRule() (*[]DetectRule, *[]string, error)
func (*Client) GetUserList ¶
GetUserList will pull user form sspanel
func (*Client) ParseSSNodeResponse ¶
ParseSSNodeResponse parse the response for the given nodeinfor format
func (*Client) ParseTrojanNodeResponse ¶
ParseTrojanNodeResponse parse the response for the given nodeinfor format
func (*Client) ParseV2rayNodeResponse ¶
func (c *Client) ParseV2rayNodeResponse(body []byte, notParseNode, parseRule bool) (*NodeInfo, error)
ParseV2rayNodeResponse parse the response for the given nodeinfor format
func (*Client) ReportUserTraffic ¶
func (c *Client) ReportUserTraffic(userTraffic *[]UserTraffic) error
ReportUserTraffic reports the user traffic
type Config ¶
type Config struct {
APIHost string `mapstructure:"ApiHost"`
NodeID int `mapstructure:"NodeID"`
Key string `mapstructure:"ApiKey"`
NodeType string `mapstructure:"NodeType"`
EnableVless bool `mapstructure:"EnableVless"`
EnableXTLS bool `mapstructure:"EnableXTLS"`
//EnableSS2022 bool `mapstructure:"EnableSS2022"`
Timeout int `mapstructure:"Timeout"`
SpeedLimit float64 `mapstructure:"SpeedLimit"`
DeviceLimit int `mapstructure:"DeviceLimit"`
RuleListPath string `mapstructure:"RuleListPath"`
DisableCustomConfig bool `mapstructure:"DisableCustomConfig"`
}
type DetectResult ¶
type DetectRule ¶
type NodeInfo ¶
type NodeInfo struct {
DeviceLimit int
SpeedLimit uint64
NodeType string
NodeId int
TLSType string
EnableVless bool
EnableTls bool
//EnableSS2022 bool
V2ray *V2rayConfig
Trojan *TrojanConfig
SS *SSConfig
}
type OnlineUser ¶
type TrojanConfig ¶
type TrojanUserInfo ¶
type TrojanUserInfo struct {
Password string `json:"password"`
}
type UserInfo ¶
type UserInfo struct {
/*DeviceLimit int `json:"device_limit"`
SpeedLimit uint64 `json:"speed_limit"`*/
UID int `json:"id"`
Port int `json:"port"`
Cipher string `json:"cipher"`
Secret string `json:"secret"`
V2rayUser *V2RayUserInfo `json:"v2ray_user"`
TrojanUser *TrojanUserInfo `json:"trojan_user"`
}
func (*UserInfo) GetUserEmail ¶
type UserListBody ¶
type UserListBody struct {
//Msg string `json:"msg"`
Data []UserInfo `json:"data"`
}
type UserTraffic ¶
type V2RayUserInfo ¶
type V2rayConfig ¶
type V2rayConfig struct {
Inbounds []conf.InboundDetourConfig `json:"inbounds"`
Routing *struct {
Rules json.RawMessage `json:"rules"`
} `json:"routing"`
}
Click to show internal directories.
Click to hide internal directories.