Documentation
¶
Index ¶
- type AliveMap
- type ClientV1
- func (c *ClientV1) GetUserAlive() (map[int]int, error)
- func (c *ClientV1) GetUserList() ([]UserInfo, error)
- func (c *ClientV1) ReportNodeOnlineUsers(data *[]OnlineUser) error
- func (c *ClientV1) ReportNodeStatus(nodeStatus *NodeStatus) (err error)
- func (c *ClientV1) ReportUserTraffic(userTraffic *[]UserTraffic) error
- type ClientV2
- type DNSItem
- type Data
- type NodeInfo
- type NodeStatus
- type OnlineUser
- type Outbound
- type Protocol
- type ServerConfigResponse
- type ServerPushStatusRequest
- type ServerPushUserTrafficRequest
- type UserInfo
- type UserListBody
- type UserOnlineBody
- type UserTraffic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientV1 ¶
type ClientV1 struct {
Client *resty.Client
APIHost string
SecretKey string
NodeType string
NodeId int
UserList *UserListBody
AliveMap *AliveMap
// contains filtered or unexported fields
}
func NewClientV1 ¶
func NewClientV1(c *conf.NodeApiConfig) (*ClientV1, error)
func (*ClientV1) GetUserList ¶
func (*ClientV1) ReportNodeOnlineUsers ¶
func (c *ClientV1) ReportNodeOnlineUsers(data *[]OnlineUser) error
func (*ClientV1) ReportNodeStatus ¶
func (c *ClientV1) ReportNodeStatus(nodeStatus *NodeStatus) (err error)
func (*ClientV1) ReportUserTraffic ¶
func (c *ClientV1) ReportUserTraffic(userTraffic *[]UserTraffic) error
type ClientV2 ¶
type ClientV2 struct {
Client *resty.Client
APIHost string
SecretKey string
ServerId int
ServerConfigEtag string
// contains filtered or unexported fields
}
func NewClientV2 ¶
func NewClientV2(c *conf.ServerApiConfig) *ClientV2
type Data ¶
type Data struct {
TrafficReportThreshold int `json:"traffic_report_threshold"`
PushInterval int `json:"push_interval"`
PullInterval int `json:"pull_interval"`
IPStrategy string `json:"ip_strategy"`
DNS *[]DNSItem `json:"dns"`
Block *[]string `json:"block"`
Outbound *[]Outbound `json:"outbound"`
Protocols *[]Protocol `json:"protocols"`
Total int `json:"total"`
}
type OnlineUser ¶
type Protocol ¶
type Protocol struct {
Type string `json:"type"`
Port int `json:"port"`
Enable bool `json:"enable"`
Security string `json:"security"`
SNI string `json:"sni"`
AllowInsecure bool `json:"allow_insecure"`
Fingerprint string `json:"fingerprint"`
RealityServerAddr string `json:"reality_server_addr"`
RealityServerPort int `json:"reality_server_port"`
RealityPrivateKey string `json:"reality_private_key"`
RealityPublicKey string `json:"reality_public_key"`
RealityShortID string `json:"reality_short_id"`
Transport string `json:"transport"`
Host string `json:"host"`
Path string `json:"path"`
ServiceName string `json:"service_name"`
Cipher string `json:"cipher"`
ServerKey string `json:"server_key"`
Flow string `json:"flow"`
HopPorts string `json:"hop_ports"`
HopInterval int `json:"hop_interval"`
ObfsPassword string `json:"obfs_password"`
DisableSNI bool `json:"disable_sni"`
ReduceRTT bool `json:"reduce_rtt"`
UDPRelayMode string `json:"udp_relay_mode"`
CongestionController string `json:"congestion_controller"`
Multiplex string `json:"multiplex"`
PaddingScheme string `json:"padding_scheme"`
UpMbps int `json:"up_mbps"`
DownMbps int `json:"down_mbps"`
Obfs string `json:"obfs"`
ObfsHost string `json:"obfs_host"`
ObfsPath string `json:"obfs_path"`
XHTTPMode string `json:"xhttp_mode"`
XHTTPExtra string `json:"xhttp_extra"`
Encryption string `json:"encryption"`
EncryptionMode string `json:"encryption_mode"`
EncryptionRTT string `json:"encryption_rtt"`
EncryptionTicket string `json:"encryption_ticket"`
EncryptionServerPadding string `json:"encryption_server_padding"`
EncryptionPrivateKey string `json:"encryption_private_key"`
EncryptionClientPadding string `json:"encryption_client_padding"`
EncryptionPassword string `json:"encryption_password"`
CertMode string `json:"cert_mode"`
CertDNSProvider string `json:"cert_dns_provider"`
CertDNSEnv string `json:"cert_dns_env"`
}
type ServerConfigResponse ¶
type ServerConfigResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data *Data `json:"data"`
}
func GetServerConfig ¶
func GetServerConfig(c *ClientV2) (*ServerConfigResponse, error)
type ServerPushStatusRequest ¶
type ServerPushUserTrafficRequest ¶
type ServerPushUserTrafficRequest struct {
Traffic []UserTraffic `json:"traffic"`
}
type UserListBody ¶
type UserListBody struct {
Users []UserInfo `json:"users"`
}
type UserOnlineBody ¶
type UserOnlineBody struct {
Users []OnlineUser `json:"users"`
}
type UserTraffic ¶
Click to show internal directories.
Click to hide internal directories.