From c90732be1713e59cddb5080b2c9f01daebf1a5f1 Mon Sep 17 00:00:00 2001 From: baker-yuan <40530122+baker-yuan@users.noreply.github.com> Date: Sun, 4 Jun 2023 10:07:23 +0800 Subject: [PATCH] =?UTF-8?q?doc=EF=BC=9A=E4=BF=AE=E5=A4=8Dhttp-to-grpc?= =?UTF-8?q?=E6=A1=88=E4=BE=8B=E4=B8=8D=E8=83=BD=E8=B7=91=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/apinto/plugins/http-to-grpc.md | 43 +++++++++++------------------ 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/docs/apinto/plugins/http-to-grpc.md b/docs/apinto/plugins/http-to-grpc.md index 6e1b11e..a3c84e6 100644 --- a/docs/apinto/plugins/http-to-grpc.md +++ b/docs/apinto/plugins/http-to-grpc.md @@ -75,22 +75,16 @@ curl -X POST 'http://127.0.0.1:9400/api/setting/plugin' \ ##### 配置gRPC上游服务 ```shell curl -X POST 'http://127.0.0.1:9400/api/service' -H 'Content-Type:application/json' -d '{ - "balance":"round-robin", - "create":"2023-02-17 12:33:09", - "description":"", - "discovery":"", + "name":"grpc_api", "driver":"http", - "id":"grpc_demo@service", - "name":"grpc_demo", + "description":"grpc服务", + "timeout":2000, + "retry":3, + "scheme":"http", "nodes":[ "127.0.0.1:9001" ], - "pass_host":"node", - "profession":"service", - "retry":0, - "scheme":"HTTP", - "timeout":2000, - "update":"2023-02-27 19:59:45" + "balance":"round-robin" }' ``` @@ -99,41 +93,36 @@ curl -X POST 'http://127.0.0.1:9400/api/service' -H 'Content-Type:application/j ```shell curl -X POST 'http://127.0.0.1:9400/api/router' -H 'Content-Type:application/json' -d '{ - "listen":8099, + "name":"grpc_router", + "driver": "http", + "description":"grpc路由", + "listen":80, "method":[ "GET", "POST" ], "host":[ - ], "location":"/Service.Hello/Hello", "rules":[ - ], - "service":"grpc_demo@service", - "template":"", - "websocket":false, - "disable":false, + "service":"grpc_api@service", "plugins":{ "http_to_grpc":{ "disable":false, "config":{ + "service":"Service.Hello", + "method":"Hello", "authority":"", "format":"json", "headers":{ - }, - "method":"", - "protobuf_id":"demo@transcode", - "reflect":false, - "service":"" + "reflect":true } } }, - "retry":0, - "time_out":0, - "description":"" + "retry":3, + "time_out":2000 }' ```