Skip to content

Commit

Permalink
Update ch4-06-grpc-ext.md
Browse files Browse the repository at this point in the history
  • Loading branch information
whtiehack authored Mar 8, 2019
1 parent cb51546 commit 8b2ca8b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ch4-rpc/ch4-06-grpc-ext.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ protoc \
hello.proto
```

> windows:
```
protoc --proto_path=%GOPATH%/src --proto_path=%GOPATH%/src/github.com/google/protobuf/src --proto_path=. --govalidators_out=. --go_out=plugins=grpc:. hello.proto
```
> windows:替换 `${GOPATH}``%GOPATH%` 即可.

以上的命令会调用protoc-gen-govalidators程序,生成一个独立的名为hello.validator.pb.go的文件:

Expand Down Expand Up @@ -222,10 +220,7 @@ $ protoc -I/usr/local/include -I. \
hello.proto
```

> windows:
```
protoc -I. -I%GOPATH%/src -I%GOPATH%/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=. --go_out=plugins=grpc:. hello.proto
```
> windows:替换 `${GOPATH}``%GOPATH%` 即可.
插件会为RestService服务生成对应的RegisterRestServiceHandlerFromEndpoint函数:

Expand Down

0 comments on commit 8b2ca8b

Please sign in to comment.