refactor: implement automatic reflection #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces dynamic server reflection support to the
grancCLI, allowing users to call gRPC services without needing a local descriptor file. The changes include new reflection client logic, CLI and core refactoring, an updated README, and build system improvements.Server Reflection Support:
grpc.reflection.v1proto file togranc/proto/reflection.prototo enable dynamic schema fetching from servers that support reflection.granc/src/core.rs) to resolve service descriptors either from a local file or dynamically via server reflection. The CLI now works seamlessly whether or not a--proto-setis provided.CLI and Core Refactoring:
granc/src/cli.rs, now supporting an optional--proto-set, improved endpoint parsing, and conversion to the new internal coreInputtype.granc/src/core.rsand implemented a more structured input, output and error handling, now making the core logic unit testable.Documentation and Usability:
granc/README.mdto document the new server reflection feature, clarify usage with and without descriptor files, and revise CLI argument documentation and examples. [1] [2] [3] [4] [5]Generating a reflection service:
granc/Cargo.tomlto add agen-protofeature, declare both binaries (grancandgenerate_reflection_service), and manage dependencies for reflection and proto generation.Makefile.tomlwith new tasks for generating the reflection service client.