mirror of
https://github.com/dalbodeule/hop-gate.git
synced 2025-12-09 13:25:44 +09:00
[feat](protocol): implement Protobuf codec and integrate into default WireCodec
- Introduced `protobufCodec` supporting length-prefixed Protobuf serialization/deserialization. - Replaced JSON-based `DefaultCodec` with Protobuf-based implementation. - Updated generated Protobuf Go types, aligning with `go_package` updates in `hopgate_stream.proto`. - Added constants and safeguards for Protobuf envelope size limits. - Modified `Makefile` to accommodate updated Protobuf generation logic.
This commit is contained in:
6
Makefile
6
Makefile
@@ -72,11 +72,15 @@ docker-server:
|
||||
# - 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.
|
||||
# NOTE:
|
||||
# - go_package in hopgate_stream.proto is set to:
|
||||
# github.com/dalbodeule/hop-gate/internal/protocol/pb;protocolpb
|
||||
# - With --go_out=. (without paths=source_relative), protoc will place the
|
||||
# generated file under internal/protocol/pb according to go_package.
|
||||
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