From 15351a0401ab3f505bd885728e234dee8472f0e5 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Sun, 28 Apr 2019 22:36:09 -0700 Subject: [PATCH] Changes to deserializeBinary API; --- javascript/net/grpc/web/gatewayclientbase.js | 4 ++-- net/grpc/gateway/docker/envoy/Dockerfile | 2 +- net/grpc/gateway/examples/echo/echo.proto | 9 +++------ net/grpc/gateway/examples/helloworld/helloworld.proto | 6 +++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/javascript/net/grpc/web/gatewayclientbase.js b/javascript/net/grpc/web/gatewayclientbase.js index ffd6ec34..72a791a6 100644 --- a/javascript/net/grpc/web/gatewayclientbase.js +++ b/javascript/net/grpc/web/gatewayclientbase.js @@ -181,8 +181,8 @@ GatewayClientBase.parseRpcStatus_ = function(data) { var metadata = {}; var details = rpcStatus.getDetailsList(); for (var i = 0; i < details.length; i++) { - var pair = Pair.deserializeBinary( - details[i].getValue()); + var pair = details[i].unpackJspbCompat( + Pair, Pair.deserializeBinary, 'grpc.gateway.Pair'); var first = googCrypt.utf8ByteArrayToString( pair.getFirst_asU8()); var second = googCrypt.utf8ByteArrayToString( diff --git a/net/grpc/gateway/docker/envoy/Dockerfile b/net/grpc/gateway/docker/envoy/Dockerfile index 017073d3..3000fbfd 100644 --- a/net/grpc/gateway/docker/envoy/Dockerfile +++ b/net/grpc/gateway/docker/envoy/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM envoyproxy/envoy-dev:latest +FROM envoyproxy/envoy:latest COPY net/grpc/gateway/examples/echo/envoy.yaml /etc/envoy/envoy.yaml diff --git a/net/grpc/gateway/examples/echo/echo.proto b/net/grpc/gateway/examples/echo/echo.proto index 4dc1678d..60171d0f 100644 --- a/net/grpc/gateway/examples/echo/echo.proto +++ b/net/grpc/gateway/examples/echo/echo.proto @@ -16,8 +16,7 @@ syntax = "proto3"; package grpc.gateway.testing; -message Empty { -} +message Empty {} message EchoRequest { string message = 1; @@ -67,8 +66,7 @@ service EchoService { rpc Echo(EchoRequest) returns (EchoResponse); // Sends back abort status. - rpc EchoAbort(EchoRequest) returns (EchoResponse) { - }; + rpc EchoAbort(EchoRequest) returns (EchoResponse) {} // One empty request, ZERO processing, followed by one empty response // (minimum effort to do message serialization). @@ -82,8 +80,7 @@ service EchoService { // One request followed by a sequence of responses (streamed download). // The server abort directly. rpc ServerStreamingEchoAbort(ServerStreamingEchoRequest) - returns (stream ServerStreamingEchoResponse) { - } + returns (stream ServerStreamingEchoResponse) {} // A sequence of requests followed by one response (streamed upload). // The server returns the total number of messages as the result. diff --git a/net/grpc/gateway/examples/helloworld/helloworld.proto b/net/grpc/gateway/examples/helloworld/helloworld.proto index 5ca7da68..e95d57b8 100644 --- a/net/grpc/gateway/examples/helloworld/helloworld.proto +++ b/net/grpc/gateway/examples/helloworld/helloworld.proto @@ -18,11 +18,11 @@ package helloworld; service Greeter { // unary call - rpc SayHello (HelloRequest) returns (HelloReply); + rpc SayHello(HelloRequest) returns (HelloReply); // server streaming call - rpc SayRepeatHello (RepeatHelloRequest) returns (stream HelloReply); + rpc SayRepeatHello(RepeatHelloRequest) returns (stream HelloReply); // unary call - response after a length delay - rpc SayHelloAfterDelay (HelloRequest) returns (HelloReply); + rpc SayHelloAfterDelay(HelloRequest) returns (HelloReply); } message HelloRequest {