refactor(gRPC): update go proto file

This commit is contained in:
Bo-Yi Wu
2022-11-09 14:18:51 +08:00
parent e13a05bc08
commit 8b4424c518
4 changed files with 33 additions and 25 deletions

View File

@@ -12,6 +12,9 @@ GOFILES := $(shell find . -name "*.go" -type f)
TAGS ?= sqlite
LDFLAGS ?= -X 'main.Version=$(VERSION)'
PROTOC_GEN_GO=v1.28
PROTOC_GEN_GO_GRPC=v1.2
ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null)
else
@@ -163,6 +166,11 @@ clean:
find . -name *.db -delete
-rm -rf release dist .cover
.PHONY: proto_install
proto_install:
$(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO)
$(GO) install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GEN_GO_GRPC)
generate_proto_js:
npm install grpc-tools
protoc -I rpc/proto rpc/proto/gorush.proto --js_out=import_style=commonjs,binary:rpc/example/node/ --grpc_out=rpc/example/node/ --plugin=protoc-gen-grpc="node_modules/.bin/grpc_tools_node_protoc_plugin"