Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: protobuf gen #81

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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