proxy-pool/docs/configuration/examples.md

36 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 配置样例索引
`examples/config` 下每个文件都是可独立加载的 Version 1 完整配置,不是 YAML
片段。示例域名使用保留的 `.example` 后缀Secret 使用带引号的
`${ENVIRONMENT_VARIABLE}` 占位符。
1. `01-local-all.yaml`:本机同时启用 Gateway 与独占提取。
2. `02-gateway-only.yaml`:仅 GatewayGET/HEAD 安全重试。
3. `03-extract-only.yaml`:仅一次性独占提取。
4. `04-public-gateway-basic-auth.yaml`:公网 Gateway 基础认证。
5. `05-public-extract-api-key.yaml`:公网提取 API Key 认证。
6. `06-internal-cidr-no-auth.yaml`内网无认证CIDR 访问控制。
7. `07-auth-any.yaml`IP 白名单或 API Key 任一通过。
8. `08-sequential-failover.yaml`:连续 Empty 后从 A 切到 B。
9. `09-weighted-routing.yaml`70/30 Upstream 权重。
10. `10-round-robin-routing.yaml`Upstream 轮询。
11. `11-random-routing.yaml`Upstream 随机选择。
12. `12-least-connections-routing.yaml`:按本地连接容量选择。
13. `13-extract-all-or-nothing.yaml`:数量不足时整批回滚。
14. `14-gateway-reserve.yaml`:共享池为 Gateway 保留库存。
15. `15-strict-ttl-health.yaml`:严格 TTL 与健康新鲜度过滤。
16. `16-provider-basic-auth.yaml`Provider Basic Auth。
17. `17-provider-api-key.yaml`Provider Header API Key。
18. `18-provider-post-json.yaml`Provider JSON POST 与有界解析。
19. `19-socks5-upstream.yaml`SOCKS5 Upstream 模型。
20. `20-fetch-billing-quota.yaml`:当前库存与累计计费额度分离。
批量验证:
```powershell
go test -count=1 ./examples/config
```
项目的配置测试应遍历该目录,以严格加载器解析并校验每个文件。示例中的
Provider URL 不是连通性测试目标;配置验证只校验语法、引用和不变量。