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-go
Run:
go run server/app/main.go
go run server/gateway/main.go
go run client/main.go
To generate server code:
protoc -I. -I./proto --go_out=plugins=grpc,paths=source_relative:./proto_generated proto/user/user.proto
To generate grpc-gateway code:
protoc -I. -I./proto/. --grpc-gateway_out=logtostderr=true,paths=source_relative:./proto_generated proto/user/user.proto
error proto:
protoc -I. --go_out=plugins=grpc,paths=source_relative:./ errors/error.proto
todo