Files
check-https-proxy-node/common/common.go
2025-01-09 17:19:44 +08:00

41 lines
1.6 KiB
Go

package common
import "time"
type Config struct {
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 {
Protocol string `mapstructure:"protocol" yaml:"protocol" json:"protocol"`
Username string `mapstructure:"username" yaml:"username" json:"username"`
Password string `mapstructure:"password" yaml:"password" json:"password"`
Addr string `mapstructure:"addr" yaml:"addr" json:"addr"`
Port int `mapstructure:"port" yaml:"port" json:"port"`
}