mirror of
https://codeberg.org/JasterV/granc.git
synced 2026-04-26 18:40:05 +00:00
This PR implements a new subcommand `doc` that generates markdown documentation for a given gRPC service! **Description** For the most part, the inner logic of this subcommand is the same as the `describe`, the only thing that changes is the way that the found descriptor is transformed to a final output. In this case, a `Packages` type has been implemented to transform a `ServiceDescriptor` into a map of `Package`s. Each package groups all the file descriptors with the same package name (or namespace). A `Package` contains all the necessary information for a file of documentation to be generated (All its contained services, messages and enum descriptors and its name). The output of this command is a folder with all the generated documentation, which contains a file per protobuf package. **Introduced the `granc-test-support` crate** * Renamed the `echo_service` crate as `granc-test-support`, providing both the definition of a protobuf service for integration testing and a function to compile protobuffer at runtime into a file descriptor (Potentially this could be used to let users pass a folder to a proto project in addition to the server reflection and the local file descriptor options. For example, the `call` command could compile a file descriptor on the fly from a folder containing a protobuffer project before making the call to the gRPC server. **Descriptor API Enhancements:** * Added `name`, `full_name`, and `package_name` methods to the `Descriptor` enum to simplify access to descriptor metadata. (`granc-core/src/client/types.rs`) **Dependency Management Improvements:** * Added grouping for gRPC-related dependencies in `dependabot.yml` for improved automated dependency updates. (`.github/dependabot.yml`)
86 lines
1.1 KiB
Markdown
86 lines
1.1 KiB
Markdown
<a id="Author"></a>
|
|
## Author
|
|
|
|
### Definition
|
|
|
|
```protobuf
|
|
package library.domain;
|
|
|
|
message Author {
|
|
string id = 1;
|
|
string full_name = 2;
|
|
repeated library.domain.Book bibliography = 3;
|
|
}
|
|
```
|
|
|
|
### Dependencies
|
|
|
|
- Field `bibliography`: [Book](library.domain.md#Book)
|
|
|
|
---
|
|
|
|
<a id="Book"></a>
|
|
## Book
|
|
|
|
### Definition
|
|
|
|
```protobuf
|
|
package library.domain;
|
|
|
|
message Book {
|
|
string isbn = 1;
|
|
string title = 2;
|
|
library.domain.Author author = 3;
|
|
library.domain.Publisher publisher = 4;
|
|
library.domain.Genre genre = 5;
|
|
}
|
|
```
|
|
|
|
### Dependencies
|
|
|
|
- Field `author`: [Author](library.domain.md#Author)
|
|
- Field `publisher`: [Publisher](library.domain.md#Publisher)
|
|
- Field `genre`: [Genre](library.domain.md#Genre)
|
|
|
|
---
|
|
|
|
<a id="Publisher"></a>
|
|
## Publisher
|
|
|
|
### Definition
|
|
|
|
```protobuf
|
|
package library.domain;
|
|
|
|
message Publisher {
|
|
string id = 1;
|
|
string name = 2;
|
|
string address = 3;
|
|
}
|
|
```
|
|
|
|
### Dependencies
|
|
|
|
*None*
|
|
|
|
---
|
|
|
|
<a id="Genre"></a>
|
|
## Genre
|
|
|
|
### Definition
|
|
|
|
```protobuf
|
|
package library.domain;
|
|
|
|
enum Genre {
|
|
UNKNOWN = 0;
|
|
FICTION = 1;
|
|
NON_FICTION = 2;
|
|
SCI_FI = 3;
|
|
HISTORY = 4;
|
|
}
|
|
```
|
|
|
|
---
|
|
|