Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPrivateIP

func IsPrivateIP(ipStr string) bool

IsPrivateIP 判断是否为内网IP

Types

type ConfigService

type ConfigService struct{}

ConfigService 配置管理服务

func NewConfigService

func NewConfigService() *ConfigService

NewConfigService 创建配置服务

func (*ConfigService) InitConfig

func (s *ConfigService) InitConfig() error

InitConfig 初始化配置(交互式)

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 NewIPResolver

func NewIPResolver() *IPResolver

NewIPResolver 创建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) GetGroups

func (s *ProxyService) GetGroups() (map[string]model.Group, []string, error)

GetGroups 获取所有策略组

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 测试单个代理延迟

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL