Documentation ¶
Index ¶
- type AddClientInfo
- type AddTunnelInfo
- type Client
- type ClientCnf
- type ClientRate
- type Flow
- type ListClientFilter
- type ListClientResponse
- type ListTunnelFilter
- type ListTunnelResponse
- type ModType
- type Sever
- func (s *Sever) AddClient(info AddClientInfo) error
- func (s *Sever) AddTunnel(tunnel AddTunnelInfo) error
- func (s *Sever) DeleteClient(clientId int64) error
- func (s *Sever) DeleteTunnel(tunnelId int64) error
- func (s *Sever) GetClient(clientId int64) (client Client, err error)
- func (s *Sever) GetClientList(filter ListClientFilter) (clients ListClientResponse, err error)
- func (s *Sever) GetClientTunnel(filter ListTunnelFilter) (tunnels ListTunnelResponse, err error)
- type Tunnel
- type TunnelTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddClientInfo ¶
type AddTunnelInfo ¶
type Client ¶
type Client struct { Cnf ClientCnf Id int64 VerifyKey string Addr string Remark string Status bool IsConnect bool RateLimit int64 Flow Flow Rate ClientRate NoStore bool NoDisplay bool MaxConn int64 NowConn int64 WebUserName string WebPassword string ConfigConnAllow bool MaxTunnelNum int64 Version string }
type ClientRate ¶
type ClientRate struct {
NowRate int64
}
type ListClientFilter ¶
type ListClientResponse ¶
type ListTunnelFilter ¶
type ListTunnelResponse ¶
type Sever ¶
func (*Sever) AddClient ¶
func (s *Sever) AddClient(info AddClientInfo) error
AddClient 添加客户端 remark 不可为空,verifyKey 为空时,由 nps 服务器自动生成
func (*Sever) AddTunnel ¶
func (s *Sever) AddTunnel(tunnel AddTunnelInfo) error
AddTunnel 添加隧道 modeType 为必传项,modeType 请从 nps包中获取已定义好的以"ModType"开头的常量,注意自行转化的不认,会返回错误 remark 不可为空, port 必须在 10000 ~ 11000 范围内 --去掉端口号限制 target 不可为 0
func (*Sever) GetClientList ¶
func (s *Sever) GetClientList(filter ListClientFilter) (clients ListClientResponse, err error)
GetClientList 获取客户端列表 start, limit 不可小于 0, search 可为空
func (*Sever) GetClientTunnel ¶
func (s *Sever) GetClientTunnel(filter ListTunnelFilter) (tunnels ListTunnelResponse, err error)
GetClientTunnel 获取隧道列表 modeType 为必传项,modeType 请从 nps包中获取已定义好的以"ModType"开头的常量,注意自行转化的不认,会返回错误 offset, limit 不可小于 0
type Tunnel ¶
type Tunnel struct { Id int64 Port int64 ServerIp string Mode string Status bool RunStatus bool Client Client Ports string Flow Flow Password string Remark string TargetAddr string NoStore bool LocalPath string StripPre string Target TunnelTarget MultiAccount interface{} // todo 不确定结构,http 结果为 null 暂无法推测 HealthCheckTimeout int64 HealthMaxFail int64 HealthCheckInterval int64 HealthNextTime string HealthMap map[string]interface{} // todo 不确定结构,http 结果为 null 暂无法推测 HttpHealthUrl string HealthRemoveArr interface{} // todo 不确定结构,http 结果为 null 暂无法推测 HealthCheckType string HealthCheckTarget string }
type TunnelTarget ¶
Click to show internal directories.
Click to hide internal directories.