brew install protobuf@3.1
echo 'export PATH="/usr/local/opt/protobuf@3.1/bin:$PATH"' >> ~/.bash_profile
protoc \
-I/usr/local/include \
-I. \
-I$(go env GOPATH)/src \
-I$(go env GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:. \
pb/service.proto
Code is in
server/server.go
andserver/server_test.go
protoc \
-I/usr/local/include \
-I. \
-I$(go env GOPATH)/src \
-I$(go env GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--grpc-gateway_out=logtostderr=true:. \
pb/service.proto
Code is in
cmd/restapi.go
and
protoc \
-I/usr/local/include \
-I. \
-I$(go env GOPATH)/src \
-I$(go env GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--swagger_out=logtostderr=true:. \
pb/service.proto
Code is in
pb/service.swagger.json
andserver/server_test.go