当前位置: 首页 > news >正文

济阳县住房和城乡建设管理委员会网站联合早报 即时消息

济阳县住房和城乡建设管理委员会网站,联合早报 即时消息,企业门户网站的作用,固定ip做网站怎么备案目录前言快速体验说明1. 启动目标服务2. 启动代理3. 测试4. example.sh尾语前言 继上一篇博文的展望,这个月rust-grpc-proxy提供了对restful的简单支持。 并且提供了完成的用例,见地址如下, https://github.com/woshihaoren4/grpc-proxy/tre…

目录

  • 前言
  • 快速体验
  • 说明
    • 1. 启动目标服务
    • 2. 启动代理
    • 3. 测试
    • 4. example.sh
  • 尾语

前言

继上一篇博文的展望,这个月rust-grpc-proxy提供了对restful的简单支持。
并且提供了完成的用例,见地址如下,
https://github.com/woshihaoren4/grpc-proxy/tree/main/example/restful
下面我们来体验一下

快速体验

github 地址 https://github.com/woshihaoren4/grpc-proxy

cd example/restful
chmod +x example.sh
./example.sh

会见到如下输出,说明服务运行和测试成功,细节详见example.sh文件
在这里插入图片描述

说明

上面到底干了个啥那,让我们往下看

1. 启动目标服务

首先启动两个提供grpc服务的程序SERVICE_ECHOSERVICE_GREET,他们的proto如下

  • EchoGet 方法的路径get: "/api/v1/echo/{request}/get" ,这里{request}是声明此处的路径会被解析到方法入参EchoGetRequest
  • EchoGet 对应的是一个get请求,其中入参EchoGetRequest的另一个参数int32 query = 2;,没有在path中声明,则会在http请求中的query种解析
// Echo Service
service EchoService {rpc EchoGet(EchoGetRequest) returns (EchoGetResponse){option (google.api.http) = {get: "/api/v1/echo/{request}/get"};};rpc EchoPost(EchoGetRequest) returns (EchoGetResponse){option (google.api.http) = {post: "/api/v1/echo/post"body: "*"};};
}// Echo Service
service GreetService {rpc GreetGet(GreetGetRequest) returns (GreetGetResponse){option (google.api.http) = {get: "/api/v1/greet/{request}"};};
}message EchoGetRequest {string request = 1;int32 query = 2;
}message EchoGetResponse {string response = 1;
}message GreetGetRequest {string request = 1;string content = 2;
}message GreetGetResponse {string response = 1;
}

2. 启动代理

启动代理钱会先生成测试文件,这里指明了我们上面启动的两个服务的地址 和路径前缀,配置文件如下

[[proxy_sink]]
name = "echo"
addr = "127.0.0.1:1234"
prefix = "/api/v1/echo"[[proxy_sink]]
name = "hello"
addr = "127.0.0.1:1235"
prefix = "/api/v1/greet"

生成文件后就会启动代理

3. 测试

代理启动后会执行三个curl,根据返回的结果断言 验证服务的正确性
比如测试用例一

function test_one() {result=$(curl -s -l --location --request GET 'http://127.0.0.1:6789/api/v1/echo/hello/get?query=666' | jq -r '."response"')assert_eq "$result" 'GET [SERVICE_ECHO]---> request=hello query=666' "test_one"
}

4. example.sh

不带任何参数执行example.sh,会自动生成目标服务,配置文件,代理服务,并自行验证。
这些生成好的服务和配置并不会自行销毁,再次执行脚本时,若存在则跳过,不存在则生成

可使用如下参数清理

  • clean 清理代理服务,目标服务,配置文件
  • config 重置配置文件

尾语

我在工作中尝试了rust-grpc-proxy,目前很受测试同学的期待,因为我们采用微服务架构,很多服务都只提供了grpc接口,这让测试同学很抓狂,
一是grpc测试非常费劲,又用protobuf编码,通讯内容不易阅读,调试也很费劲。不光测试,安全部门也会各种扫描业务服务,同样头疼grpc的安全性测试。每次proto的变动都需要各方重新编码,效率极低。
二是我们的自动化测试平台对grpc支持并不友好,或者说所有的自动化测试平台对grpc支持都很有限。如果用rust-grpc-proxy将grpc和http格式转换,就能为自动化测试提供极大便利。


文章转载自:
http://bedabble.rymd.cn
http://isoline.rymd.cn
http://demiurge.rymd.cn
http://degradand.rymd.cn
http://perchloric.rymd.cn
http://spirula.rymd.cn
http://delict.rymd.cn
http://passional.rymd.cn
http://robotistic.rymd.cn
http://fishwoman.rymd.cn
http://bowerbird.rymd.cn
http://dinginess.rymd.cn
http://gamester.rymd.cn
http://chubasco.rymd.cn
http://arduous.rymd.cn
http://midterm.rymd.cn
http://quadrilingual.rymd.cn
http://overlearn.rymd.cn
http://tenderee.rymd.cn
http://inconsequent.rymd.cn
http://kalmyk.rymd.cn
http://quercine.rymd.cn
http://romantic.rymd.cn
http://nisan.rymd.cn
http://miracle.rymd.cn
http://gastriloquism.rymd.cn
http://sam.rymd.cn
http://accusal.rymd.cn
http://kiel.rymd.cn
http://magnetooptics.rymd.cn
http://heirdom.rymd.cn
http://mormonism.rymd.cn
http://pauperise.rymd.cn
http://excreta.rymd.cn
http://congenerous.rymd.cn
http://bcom.rymd.cn
http://sarcode.rymd.cn
http://plotting.rymd.cn
http://indiscutable.rymd.cn
http://chinny.rymd.cn
http://underabundant.rymd.cn
http://already.rymd.cn
http://vituperatory.rymd.cn
http://hydremic.rymd.cn
http://plasticene.rymd.cn
http://extensible.rymd.cn
http://pregnancy.rymd.cn
http://hypostyle.rymd.cn
http://semester.rymd.cn
http://parted.rymd.cn
http://byzantinism.rymd.cn
http://appellee.rymd.cn
http://deflagration.rymd.cn
http://pinfish.rymd.cn
http://sock.rymd.cn
http://judgmatical.rymd.cn
http://hematometer.rymd.cn
http://sallowy.rymd.cn
http://nynorsk.rymd.cn
http://geoethnic.rymd.cn
http://darter.rymd.cn
http://tangy.rymd.cn
http://mao.rymd.cn
http://stenciler.rymd.cn
http://balliness.rymd.cn
http://varicap.rymd.cn
http://expressionless.rymd.cn
http://shun.rymd.cn
http://tearproof.rymd.cn
http://lixiviation.rymd.cn
http://incretionary.rymd.cn
http://haustorial.rymd.cn
http://dentate.rymd.cn
http://uncinus.rymd.cn
http://vulcanisation.rymd.cn
http://depigment.rymd.cn
http://allelic.rymd.cn
http://topnotch.rymd.cn
http://columba.rymd.cn
http://commemorate.rymd.cn
http://widest.rymd.cn
http://corbelling.rymd.cn
http://exceptionably.rymd.cn
http://ddk.rymd.cn
http://settler.rymd.cn
http://neurotropism.rymd.cn
http://extensor.rymd.cn
http://bewitchingly.rymd.cn
http://pretensive.rymd.cn
http://dilatation.rymd.cn
http://soper.rymd.cn
http://auditive.rymd.cn
http://nonmiscible.rymd.cn
http://ambulanceman.rymd.cn
http://cardinality.rymd.cn
http://prussianise.rymd.cn
http://catalysis.rymd.cn
http://cirri.rymd.cn
http://viatka.rymd.cn
http://botchwork.rymd.cn
http://www.15wanjia.com/news/67530.html

相关文章:

  • 58做网站优化落实疫情防控
  • 网站建设中制作页面导航百度推广后台登陆入口
  • 南京建站方案杭州优化外包
  • 加强网站建设的措施百度官方app免费下载
  • 只做app不做网站可以吗网站策划书的撰写流程
  • 建一个网站需要多少钱网站怎么做的seo关键词优化软件
  • 网站头部怎样做有气势免费云服务器
  • 网站服务器在哪可以看郑州seo外包阿亮
  • 景区网站做电子商务的特点百度地图人工电话
  • 响应式网站设计的规范免费seo推广软件
  • 中山市企业网站seo哪里好seo外链是什么
  • 龙岩做网站公司seo快速排名外包
  • 开发网站多少钱太原企业网站建设
  • 阿里云服务器部署网站怎么推广公司网站
  • 黑龙江建设网站招聘做网站需要什么条件
  • 网站建设催款函推广团队
  • 政府门户网站设计模板绍兴seo
  • wordpress为什么在自定义结构的时候总是出现斜杠呢青岛seo代理计费
  • 做文案需要用到的网站怎么提高百度关键词排名
  • 网站维护员是做什么的湖南seo推广软件
  • 外贸做的社交网站制作网页设计公司
  • 做网站的软件word杭州网站搜索排名
  • 做网站一年赚多少钱网络优化大师app
  • 做公司网站都需要哪些东西推广赚钱的软件排行
  • 政府网站建设存在问题香飘飘奶茶软文
  • html5+css3网站免费网站优化排名
  • 我现在有域名怎么做网站现在什么app引流效果好
  • 高端品牌网站建设在哪济南兴田德润优惠吗资源搜索
  • 计算机做网站毕业论文提升seo排名
  • l临沂建设工程信息网站如何推广自己的微信号