编译proto文件时自动生成RPC列表JSON

This commit is contained in:
刘祥超
2022-06-21 21:26:22 +08:00
parent 7ad94bff2f
commit c6952e794a
4 changed files with 12876 additions and 1 deletions

View File

@@ -2,4 +2,19 @@
#rm -f ../pkg/rpc/pb/*.pb.go
protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/*.proto
protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto
RESULT=$?
if [ "${RESULT}" != "0" ]; then
exit
fi
RESULT=`protoc --go_out=plugins=grpc:../pkg/rpc --proto_path=../pkg/rpc/protos ../pkg/rpc/protos/models/*.proto`
RESULT=$?
if [ "${RESULT}" != "0" ]; then
exit
fi
# generate rpc.json
./proto-json.sh --quiet
echo "ok"

3
build/proto-json.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
go run ../cmd/proto-json/main.go $1

12628
build/rpc.json Normal file

File diff suppressed because it is too large Load Diff