Skip to content

Commit

Permalink
refactor: protobuf gen
Browse files Browse the repository at this point in the history
  • Loading branch information
xzchaoo committed Nov 7, 2023
1 parent 3cd6adc commit 677fcef
Show file tree
Hide file tree
Showing 10 changed files with 1,678 additions and 1,717 deletions.
745 changes: 373 additions & 372 deletions pkg/server/gateway/pb/gateway-for-agent.pb.go

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions pkg/server/gateway/pb/gateway-for-agent_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions pkg/server/gateway/pb/gen.sh

This file was deleted.

20 changes: 20 additions & 0 deletions pkg/server/gen-pb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e

# Doc: We need to generate protobuf golang files from `*.proto`.
# Originally, this required various binaries(protoc/protoc-gen-go/protoc-gen-java...) to be installed on the machine where the command was executed.
# This is too complex and prone to version inconsistencies.

# https://github.com/namely/docker-protoc provides a docker image containing various binaries required to generate protobuf.

cd `dirname $0`

cid=`docker run -d --rm --entrypoint=sleep -v $PWD:/defs namely/protoc-all 3600`

docker exec -it $cid /usr/local/bin/entrypoint.sh -l go -o . --go-source-relative -f pb/common.proto
docker exec -it $cid /usr/local/bin/entrypoint.sh -i /defs/pb -l go -o . --go-source-relative -f gateway/pb/gateway-for-agent.proto
docker exec -it $cid /usr/local/bin/entrypoint.sh -i /defs/pb -l go -o . --go-source-relative -f registry/pb/registry-for-agent.proto
docker exec -it $cid /usr/local/bin/entrypoint.sh -i /defs/pb -l go -o . --go-source-relative -f registry/pb/registry-for-prod.proto

docker stop $cid
echo done
247 changes: 124 additions & 123 deletions pkg/server/pb/common.pb.go

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions pkg/server/pb/gen.sh

This file was deleted.

24 changes: 0 additions & 24 deletions pkg/server/registry/pb/gen.sh

This file was deleted.

Loading

0 comments on commit 677fcef

Please sign in to comment.