From 903e87b09b8f81d8561453bd70d865e6788cead7 Mon Sep 17 00:00:00 2001 From: chai2010 Date: Sun, 15 Jul 2018 07:41:27 +0800 Subject: [PATCH] =?UTF-8?q?ch4-06:=20=E5=A2=9E=E5=8A=A0rest=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch4-rpc/ch4-06-grpc-ext.md | 117 ++++++++++- .../ch4-06-grpc-ext/rest/Makefile | 21 ++ .../ch4-06-grpc-ext/rest/helloworld.pb.go | 190 ++++++++++++++++++ .../ch4-06-grpc-ext/rest/helloworld.pb.gw.go | 180 +++++++++++++++++ .../ch4-06-grpc-ext/rest/helloworld.proto | 23 +++ .../rest/helloworld.swagger.json | 79 ++++++++ .../ch4-06-grpc-ext/rest/main.go | 73 +++++++ 7 files changed, 680 insertions(+), 3 deletions(-) create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/Makefile create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/helloworld.pb.go create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/helloworld.pb.gw.go create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/helloworld.proto create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/helloworld.swagger.json create mode 100644 vendor/gobook.examples/ch4-06-grpc-ext/rest/main.go diff --git a/ch4-rpc/ch4-06-grpc-ext.md b/ch4-rpc/ch4-06-grpc-ext.md index 346cf23..e9c5ce8 100644 --- a/ch4-rpc/ch4-06-grpc-ext.md +++ b/ch4-rpc/ch4-06-grpc-ext.md @@ -148,11 +148,122 @@ func (this *Message) Validate() error { 通过生成的验证函数,并结合GRPC的截取器,我们可以很容易为每个方法的输入参数和返回值进行验证。 -