
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This Go server is a lightweight test and diagnostic tool built using the Gin web framework. It is designed to help developers test various HTTP behaviors, system responses, and failure scenarios in a controlled environment.
The server provides multiple endpoints that cover a wide range of real-world situations such as:
Reading and logging incoming request bodies and headers.
Simulating high CPU and memory load.
Testing delayed or long-running responses.
Triggering intentional server crashes and exits.
Handling graceful shutdowns when receiving termination signals (e.g., Ctrl+C, SIGTERM).
Each endpoint demonstrates a different server behavior, making this tool useful for:
Load and stress testing.
Client timeout and retry logic testing.
Debugging request/response handling.
Observing resource usage and stability under heavy or delayed conditions.
Experimenting with graceful shutdown and panic recovery.
The server runs on port 8080 by default and logs detailed information about incoming requests, including headers, query parameters, and body content.
It can be safely used in development or staging environments for experimenting with client-server interaction patterns, testing API resilience, or verifying monitoring and alerting setups.
| Endpoint | Method | Description | Request Body | Query / Params | Response (200) | Error / Behavior |
|---|---|---|---|---|---|---|
/post | POST | Reads and prints request body and headers. | Any raw JSON or text. | None | got it | 400 if body cannot be read. Logs headers and body to console. |
/post-heavy | POST | Simulates CPU and memory load by allocating 10 MB blocks. | { "block_count": <int> } | None | got it | 400 if invalid JSON or block_count ≤ 0. High memory and CPU usage possible. |
/get | GET | Handles GET requests with query parameters. | None | query=<string> | got it | None — logs received query and headers. |
/post-panic | POST | Triggers a panic intentionally (nil pointer dereference). | None | None | (no response, process panics) | Server crashes due to unhandled panic. |
/post-exit | POST | Forces server to exit after responding. | None | None | server shutting down... | Server terminates immediately via os.Exit(1). |
/post-long-time | POST | Simulates a long-running request (30 seconds delay). | None | None | server Response after 30s | None — useful for timeout testing. |
/post/delay/:seconds | POST | Delays response by given number of seconds. | None | :seconds (integer in path) | Response after {seconds} | 400 if invalid duration. |
| (Signal Handler) | (N/A) | Handles SIGINT and SIGTERM for graceful shutdown. | None | None | (Server shuts down cleanly) | Ensures current requests complete before stopping. |
Server Port: 8080
Content-Type: Most endpoints accept application/json or raw text.
Logging: All requests log headers, query parameters, and/or body.
Graceful Shutdown: Handled automatically on Ctrl+C or OS termination signal.
| Scenario | Command Example |
|---|---|
| Basic POST | curl -X POST http://localhost:8080/post -d '{"hello":"world"}' |
| Heavy Load | curl -X POST http://localhost:8080/post-heavy -H "Content-Type: application/json" -d '{"block_count":3}' |
| GET Query | curl "http://localhost:8080/get?query=test" |
| Delayed Response (10s) | curl -X POST http://localhost:8080/post/delay/10 |
| Long Response (30s) | curl -X POST http://localhost:8080/post-long-time |
| Simulate Panic | curl -X POST http://localhost:8080/post-panic |
| Force Exit | curl -X POST http://localhost:8080/post-exit |
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务