测试代理是否可用

This commit is contained in:
2025-01-09 17:19:44 +08:00
parent fee0c7d845
commit c7124bda81
13 changed files with 3499 additions and 188 deletions

View File

@@ -1,14 +1,34 @@
package common
const (
AppEnv = "dev"
EnvConfig = "config.json"
)
import "time"
type Config struct {
Debug bool `mapstructure:"debug" json:"debug" yaml:"debug"`
TargetURL string `mapstructure:"target_url" json:"target_url" yaml:"target_url"`
Nodes []Node `mapstructure:"nodes" json:"nodes" yaml:"nodes"`
Debug bool `mapstructure:"debug" yaml:"debug"`
TargetURL string `mapstructure:"target_url" yaml:"target_url"`
ProxyCheck ProxyCheck `mapstructure:"proxy_check" yaml:"proxy_check"`
Files Files `mapstructure:"files" yaml:"files"`
Output Output `mapstructure:"output" yaml:"output"`
}
type ProxyCheck struct {
Workers int `mapstructure:"workers" yaml:"workers"`
MaxRetries int `mapstructure:"max_retries" yaml:"max_retries"`
RetryDelay time.Duration `mapstructure:"retry_delay" yaml:"retry_delay"`
Timeout time.Duration `mapstructure:"timeout" yaml:"timeout"`
SortByLatency bool `mapstructure:"sort_by_latency" yaml:"sort_by_latency"`
SaveReport bool `mapstructure:"save_report" yaml:"save_report"`
}
type Files struct {
Nodes string `mapstructure:"nodes" yaml:"nodes"`
AvailableNodes string `mapstructure:"available_nodes" yaml:"available_nodes"`
Report string `mapstructure:"report" yaml:"report"`
}
type Output struct {
ShowProgress bool `mapstructure:"show_progress" yaml:"show_progress"`
ShowTitle bool `mapstructure:"show_title" yaml:"show_title"`
ShowLatency bool `mapstructure:"show_latency" yaml:"show_latency"`
}
type Node struct {
@@ -17,5 +37,4 @@ type Node struct {
Password string `mapstructure:"password" yaml:"password" json:"password"`
Addr string `mapstructure:"addr" yaml:"addr" json:"addr"`
Port int `mapstructure:"port" yaml:"port" json:"port"`
Ports []int `mapstructure:"ports" yaml:"ports" json:"ports"`
}