Adding Protocols
Quick Start
- Choose the scope. Put client/server messages under
src/server_frame/protocol/public/protocol/pbdesc/and server-only messages under the matchingprivate/protocol/pbdesc/. Useprotocol/common/for shared types andprotocol/config/for Excel and runtime configuration. - Add a message to an existing proto or add a proto in those directories. Follow neighboring files for package,
imports, and
go_package. Do not reuse field numbers; reserve deleted published field numbers and names. - Import the new file where needed, then reconfigure and build. These root framework directories
already collect
*.protofiles, so individual messages need no custom generation rules. - For a service/component's own
protocol/, append the new file to thePROTOCOLSlist in its existingproject_service_declare_protocolorproject_component_declare_protocoldeclaration. This is enough for ordinary messages; follow the RPC quick start for a new RPC. - Synchronize client protocols and verify requests/responses. A message declaration does not implement business behavior.
Validation
Check that generated headers contain the new type, consuming services compile, and clients use the same field
definitions. Do not edit generated .pb.h/.pb.cc or Go .pb.go files.
Customization and Design
See RPC and code generation for protocol discovery, sandboxing, descriptors, and generation rules. For atgateway handshakes or wire protocol changes, also read gateway and proxy.