Documentation
¶
Index ¶
- func IsPrivateIP(ipStr string) bool
- type ConfigService
- type ConnectionService
- type IPResolver
- type ProxyService
- func (s *ProxyService) GetGroups() (map[string]model.Group, []string, error)
- func (s *ProxyService) GetIPInfo(proxyAddr string) (*model.IPInfo, error)
- func (s *ProxyService) GetNodeChain() ([]string, error)
- func (s *ProxyService) GetProxies() (map[string]model.Proxy, error)
- func (s *ProxyService) SelectProxy(group, proxy string) error
- func (s *ProxyService) TestAllProxies(proxies []string) map[string]int
- func (s *ProxyService) TestGroupDelay(group string) error
- func (s *ProxyService) TestProxyDelay(name string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigService ¶
type ConfigService struct{}
ConfigService 配置管理服务
func (*ConfigService) LoadConfig ¶
func (s *ConfigService) LoadConfig() (*config.Config, error)
LoadConfig 加载配置
func (*ConfigService) SaveConfig ¶
func (s *ConfigService) SaveConfig(cfg *config.Config) error
SaveConfig 保存配置
func (*ConfigService) SetConfigValue ¶
func (s *ConfigService) SetConfigValue(key, value string) error
SetConfigValue 设置单个配置项
type ConnectionService ¶
type ConnectionService struct {
// contains filtered or unexported fields
}
ConnectionService 连接监控服务
func NewConnectionService ¶
func NewConnectionService(client *api.Client) *ConnectionService
NewConnectionService 创建连接服务
func (*ConnectionService) GetConnections ¶
func (s *ConnectionService) GetConnections() (*model.ConnectionsResponse, error)
GetConnections 获取连接信息
type IPResolver ¶
type IPResolver struct {
// contains filtered or unexported fields
}
IPResolver 内网IP解析器(带缓存)
func (*IPResolver) Resolve ¶
func (r *IPResolver) Resolve(ip string) *model.ResolvedIP
Resolve 解析IP地址,返回解析结果
type ProxyService ¶
type ProxyService struct {
// contains filtered or unexported fields
}
ProxyService 代理管理服务
func NewProxyService ¶
func NewProxyService(client *api.Client, testURL string, timeout int) *ProxyService
NewProxyService 创建代理服务
func (*ProxyService) GetIPInfo ¶
func (s *ProxyService) GetIPInfo(proxyAddr string) (*model.IPInfo, error)
GetIPInfo 获取当前出口 IP 信息
func (*ProxyService) GetNodeChain ¶
func (s *ProxyService) GetNodeChain() ([]string, error)
GetNodeChain 获取当前活跃节点链路
func (*ProxyService) GetProxies ¶
func (s *ProxyService) GetProxies() (map[string]model.Proxy, error)
GetProxies 获取所有代理
func (*ProxyService) SelectProxy ¶
func (s *ProxyService) SelectProxy(group, proxy string) error
SelectProxy 选择代理节点
func (*ProxyService) TestAllProxies ¶
func (s *ProxyService) TestAllProxies(proxies []string) map[string]int
TestAllProxies 批量测试代理延迟(返回每个代理的测试结果)
func (*ProxyService) TestGroupDelay ¶
func (s *ProxyService) TestGroupDelay(group string) error
TestGroupDelay 测试策略组内所有节点延迟
func (*ProxyService) TestProxyDelay ¶
func (s *ProxyService) TestProxyDelay(name string) (int, error)
TestProxyDelay 测试单个代理延迟
Click to show internal directories.
Click to hide internal directories.