You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2019/11/15 15:56:55 UTC

[GitHub] [incubator-apisix] moonming commented on a change in pull request #846: plugin(grpc-transcode): support new options for `protocol buffer` encoding.

moonming commented on a change in pull request #846: plugin(grpc-transcode): support new options for `protocol buffer` encoding.
URL: https://github.com/apache/incubator-apisix/pull/846#discussion_r346890969
 
 

 ##########
 File path: doc/plugins/grpc-transcoding-cn.md
 ##########
 @@ -107,3 +107,72 @@ Proxy-Connection: keep-alive
 
 这表示已成功代理。
 
+
+#### 使用 grpc-transcode 插件的 pb_option 选项
+
+在指定 route 中,代理 grpc 服务接口:
+
+**选项清单**
+ * 枚举类型
+    > enum_as_name
+    > enum_as_value
+
+ * 64位整型
+    > int64_as_number
+    > int64_as_string
+    > int64_as_hexstring
+
+ * 使用默认值
+    > auto_default_values
+    > no_default_values
+    > use_default_values
+    > use_default_metatable
+
+  * Hooks开关
+    > enable_hooks
+    > disable_hooks
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/23 -X PUT -d '
+{
+    "methods": ["GET"],
+    "uri": "/zeebe/WorkflowInstanceCreate",
+    "service_protocol": "grpc",
+    "plugins": {
+        "grpc-transcode": {
+         "proto_id": "1",
+         "service": "gateway_protocol.Gateway",
+         "method": "CreateWorkflowInstance",
+         "pb_option":["int64_as_string"]
+        }
+    },
+    "upstream": {
+        "type": "roundrobin",
+        "nodes": {
+            "127.0.0.1:26500": 1
+        }
+    }
+}'
+```
+
+#### 测试
 
 Review comment:
   need add test cases in Travis CI.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services