【文件属性】:
文件名称:pong:生成以预定义方式响应的 http 服务器
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-30 08:17:14
Go
乒乓
Pong 是一个程序,它根据配置生成具有预定义响应的 http 服务器。 Pong 用于在不同的端点故障情况下测试代理服务器。
安装:
make deps
make install
用法
pong -c config.yaml
例子:
启动响应 50% 请求的服务器,挂起 1 秒并响应另外 50% 的请求 500。
servers :
- addr : localhost:5000
readtimeout : 10s
writetimeout : 10s
handlers :
/ :
- rate : 50%
code : 200
body : ok
delay : 0s
- rate : 50%
code : 500
【文件预览】:
pong-master
----main.go(918B)
----model()
--------model.go(813B)
----Dockerfile(847B)
----config.yaml(2KB)
----examples()
--------docker.yaml(801B)
----config()
--------config.go(4KB)
----LICENSE(11KB)
----README.md(676B)
----Makefile(573B)