gRPC-Gateway helps you to provide your APIs in both gRPC and RESTful style at the same time.
- Use default
protoc --go_out=pkg/proto --go_opt=paths=source_relative \
--go-grpc_out=pkg/proto --go-grpc_opt=paths=source_relative \
internal/proto/calculator_service.proto
- Use custom
option go_package = "./pb";
protoc --go_out=pkg/generate --go_opt=Mprotos/*.proto=pb \
--go-grpc_out=pkg/generate --go-grpc_opt=Mprotos/*.proto=pb \
internal/proto/*.proto
-
Generate
pbjs -t static-module \ -w commonjs \ -o $(APP_HOME)/server/pkg/presentation/all_in_one/ui/src/model.js \ ec/v1/model/*.proto \ ec/v1/if/*.proto pbjs -t static-module \ -w commonjs \ -o $(APP_HOME)/server/external/ma/presentation/reservation/ui/src/model.js \ ec/v1/model/*.proto \ ec/v1/if/*.proto