This repo contains sample code that demonstrates some of the customization capabilities in grpc-gateway
Install deps:
- Install protobuf
- Install grpc binaries:
go install \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/golang/protobuf/protoc-gen-goRun:
go run server/app/main.gogo run server/gateway/main.gogo run client/main.go
To generate server code:
protoc -I. -I./proto --go_out=plugins=grpc,paths=source_relative:./proto_generated proto/user/user.protoTo generate grpc-gateway code:
protoc -I. -I./proto/. --grpc-gateway_out=logtostderr=true,paths=source_relative:./proto_generated proto/user/user.protoerror proto:
protoc -I. --go_out=plugins=grpc,paths=source_relative:./ errors/error.prototodo