-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gofrcli docs #1409
base: development
Are you sure you want to change the base?
add gofrcli docs #1409
Conversation
@@ -165,7 +165,7 @@ export const navigation = [ | |||
{ | |||
title: 'Testing', | |||
href: '/docs/references/testing', | |||
desc: "GoFR provides a centralized collection of mocks to facilitate writing effective unit tests. Explore testing strategies and tools for GoFR applications, ensuring your code is robust, reliable, and maintainable." | |||
desc: "GoFR provides a centralized collection of mocks to facilitate writing effective unit tests. Explore testing strategies and tools for GoFR applications, ensuring the code is robust, reliable, and maintainable." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GoFr .....
@@ -165,7 +165,7 @@ export const navigation = [ | |||
{ | |||
title: 'Testing', | |||
href: '/docs/references/testing', | |||
desc: "GoFR provides a centralized collection of mocks to facilitate writing effective unit tests. Explore testing strategies and tools for GoFR applications, ensuring your code is robust, reliable, and maintainable." | |||
desc: "GoFR provides a centralized collection of mocks to facilitate writing effective unit tests. Explore testing strategies and tools for GoFR applications, ensuring the code is robust, reliable, and maintainable." | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the path to access the CLI documentation you have written.
Managing repetitive tasks, ensuring consistency across projects, and maintaining efficiency in a development workflow can be challenging, especially when working on large-scale applications. Tasks like initializing projects, handling database migrations can become tedious and repetitive. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make it verbose...This part can be removed.
GoFr CLI addresses these challenges by providing a streamlined, all-in-one command-line tool specifically designed for GoFr applications. It simplifies tasks such as creating and managing database migrations, generating gRPC wrappers, and initializing new projects with standard GoFr conventions. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the features inline bold probably.
|
||
GoFr CLI addresses these challenges by providing a streamlined, all-in-one command-line tool specifically designed for GoFr applications. It simplifies tasks such as creating and managing database migrations, generating gRPC wrappers, and initializing new projects with standard GoFr conventions. | ||
|
||
For example, instead of manually setting up a new project structure, GoFr CLI can instantly scaffold a project with best practices in place. Similarly, managing database schema changes becomes effortless with its migration subcommands, ensuring that your database remains synchronized across environments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it in points .....
4. ***`version`*** | ||
|
||
The version command allows you to check the current version of the GoFr CLI tool installed on your system. | ||
Running this command ensures that you are using the latest version of the tool, helping you stay up to date with any new features, improvements, or bug fixes. | ||
It's a quick way to verify which version of the GoFr CLI you have. | ||
|
||
### Command Usage | ||
|
||
```bash | ||
gofr version | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version should be right after, installation and not at the last.
3. ***`wrap grpc`*** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For wrap grpc , write different section for gRPC server and different Section for gRPC Client ....
Refer the release notes of gofr-cli for the sever and client commands .... and also add the link to the examples folder for grpc-client and grpc-server.
### Command Usage | ||
```bash | ||
gofr wrap grpc server --proto=<path_to_the_proto_file> | ||
``` | ||
### Generated Files | ||
- ```{serviceName}_gofr.go (auto-generated; do not modify)``` | ||
- ```{serviceName}_server.go (example structure below)``` | ||
- ```{serviceName}_client.go (auto-generated; do not modify)``` | ||
|
||
### Example Usage: | ||
After generating the {serviceName}_client.go file, you can register and access the gRPC service as follows: | ||
|
||
```go | ||
func main() { | ||
app := gofr.New() | ||
|
||
// Create a gRPC client for the Hello service | ||
helloGRPCClient, err := {clientPackage}.NewHelloGoFrClient(app.Config.Get("GRPC_SERVER_HOST")) | ||
if err != nil { | ||
app.Logger().Errorf("Failed to create Hello gRPC client: %v", err) | ||
return | ||
} | ||
|
||
greetHandler := NewGreetHandler(helloGRPCClient) | ||
|
||
// Register HTTP endpoint for Hello service | ||
app.GET("/hello", greetHandler.Hello) | ||
|
||
// Run the application | ||
app.Run() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have written command for server, given code for the client.... Please fix this.....
- **Context-Aware Handling**: The generated server structure includes the necessary hooks to handle requests and responses seamlessly. | ||
- **Minimal Configuration**: Simplifies gRPC handler setup, focusing on business logic rather than the infrastructure. | ||
|
||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add context allows you to access DB and add traces or have tracing in gRPC inter-service calls as well.
Pull Request Template
Description:
Checklist:
goimport
andgolangci-lint
.Thank you for your contribution!