feat(proxy): 支持品赞分组代理与自动白名单
This commit is contained in:
+24
-17
@@ -7,20 +7,25 @@ import (
|
||||
|
||||
// Config 应用配置。
|
||||
type Config struct {
|
||||
TimeAPIURL string `json:"timeApiUrl"`
|
||||
Activity string `json:"activity"` // 当前活动 ID,见 internal/activity
|
||||
TraceEnabled bool `json:"traceEnabled"`
|
||||
TraceMaxBody int `json:"traceMaxBody"`
|
||||
LogLevel string `json:"logLevel"` // debug / info / warn / error
|
||||
Concurrency int `json:"concurrency"` // 同时在途的请求数上限
|
||||
Attempts int `json:"attempts"` // 仅和平小店:抢购次数缺省值(手册链路按窗口重试,不受此项影响)
|
||||
RetryStages []RetryStage `json:"retryStages"` // 精英/电竞手册的锁单重试节奏(按经过秒数分档)
|
||||
SeckillMode SeckillMode `json:"seckillMode"` // 抢购模式:0=标准, 1=激进
|
||||
XiaodianPageSize int `json:"xiaodianPageSize"`
|
||||
TimeAPIURL string `json:"timeApiUrl"`
|
||||
Activity string `json:"activity"` // 当前活动 ID,见 internal/activity
|
||||
TraceEnabled bool `json:"traceEnabled"`
|
||||
TraceMaxBody int `json:"traceMaxBody"`
|
||||
LogLevel string `json:"logLevel"` // debug / info / warn / error
|
||||
Concurrency int `json:"concurrency"` // 同时在途的请求数上限
|
||||
Attempts int `json:"attempts"` // 仅和平小店:抢购次数缺省值(手册链路按窗口重试,不受此项影响)
|
||||
RetryStages []RetryStage `json:"retryStages"` // 精英/电竞手册的锁单重试节奏(按经过秒数分档)
|
||||
SeckillMode SeckillMode `json:"seckillMode"` // 抢购模式:0=标准, 1=激进
|
||||
XiaodianPageSize int `json:"xiaodianPageSize"`
|
||||
ProxyEnabled bool `json:"proxyEnabled"` // 是否启用代理
|
||||
ProxyURL string `json:"proxyUrl"` // 代理地址,支持 http://, https://, socks5://
|
||||
ProxyAPI string `json:"proxyApi"` // 代理提取 API 地址(如星空代理)
|
||||
ProxyAPI string `json:"proxyApi"` // 代理提取 API 地址,支持品赞与通用格式
|
||||
AutoFetchProxyOnSchedule bool `json:"autoFetchProxyOnSchedule"` // 定时抢购触发前自动从 API 提取最新代理
|
||||
AccountsPerProxy int `json:"accountsPerProxy"` // 每个独立代理承载的账号数
|
||||
ProxyAutoWhitelist bool `json:"proxyAutoWhitelist"` // 提取前自动添加本机公网 IP 白名单
|
||||
ProxyWhitelistReplace bool `json:"proxyWhitelistReplace"` // 白名单已满时替换最早 IP
|
||||
ProxyWhitelistPassword string `json:"proxyWhitelistPassword"` // 白名单签名使用的登录密码
|
||||
ProxyWhitelistSignKey string `json:"proxyWhitelistSignKey"` // 白名单签名使用的 AES 密钥
|
||||
}
|
||||
|
||||
// ProxyTestResult 代理测试结果。
|
||||
@@ -34,12 +39,14 @@ type ProxyTestResult struct {
|
||||
|
||||
// ProxyFetchResult 代理 API 提取结果。
|
||||
type ProxyFetchResult struct {
|
||||
Success bool `json:"success"`
|
||||
ProxyURL string `json:"proxyUrl,omitempty"`
|
||||
IP string `json:"ip,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Success bool `json:"success"`
|
||||
ProxyURL string `json:"proxyUrl,omitempty"`
|
||||
IP string `json:"ip,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
ExpiresAt int64 `json:"expiresAt,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// XiaodianProductListOptions 是和平小店商品列表的角色与分页参数。
|
||||
|
||||
Reference in New Issue
Block a user