mirror of
https://github.com/dalbodeule/hop-gate.git
synced 2025-12-09 13:25:44 +09:00
[feat](protocol): add Protobuf schemas and code generation for hopgate streams
- Defined `hopgate_stream.proto` with message definitions for stream-based DTLS tunneling, including `Request`, `Response`, `StreamOpen`, `StreamData`, `StreamAck`, and `StreamClose`. - Added `Envelope` container for top-level message encapsulation. - Integrated Protobuf code generation into the `Makefile` using `protoc` with `protoc-gen-go`. - Generated Go types under `internal/protocol/pb`.
This commit is contained in:
14
Makefile
14
Makefile
@@ -66,3 +66,17 @@ docker-server:
|
||||
@echo "Building server Docker image..."
|
||||
docker build -f Dockerfile.server -t hop-gate-server:$(VERSION) .
|
||||
|
||||
# --- Protobuf code generation -------------------------------------------------
|
||||
# Requires:
|
||||
# - protoc (https://grpc.io/docs/protoc-installation/)
|
||||
# - protoc-gen-go (go install google.golang.org/protobuf/cmd/protoc-gen-go@latest)
|
||||
#
|
||||
# Generates Go types under internal/protocol/pb from internal/protocol/hopgate_stream.proto.
|
||||
proto:
|
||||
@echo "Generating Go code from Protobuf schemas..."
|
||||
protoc \
|
||||
--go_out=. \
|
||||
--go_opt=paths=source_relative \
|
||||
internal/protocol/hopgate_stream.proto
|
||||
@echo "Protobuf generation completed."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user