-
Notifications
You must be signed in to change notification settings - Fork 18
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
update readme.md #4
Conversation
WalkthroughThe changes in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant README
participant Examples
User->>README: Access instructions
README->>Examples: Provide command examples
User->>Examples: Replace placeholders
Examples-->>User: Execute commands
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
readme.md (3)
22-25
: Enhance placeholder explanation with specific examplesThe placeholder explanation is helpful, but could be more specific to help users.
-// your_version is the version of getty, current-time is the time when you compile the code. -// please replace your_version and current-time with the real version and time. +// Replace ${your-version} with your getty version (e.g., "1.0.0") +// Replace ${current-time} with the compilation timestamp (e.g., "20240311-1015")
97-105
: Fix command consistency and capitalizationThere are a few issues in this section:
- "mac" should be capitalized as "Mac"
- Line 105 is missing the
$
prefix for consistency with other commands-$ cd rpc/server/ && sh assembly/mac/test.sh +$ cd rpc/server/ && sh assembly/Mac/test.sh // your_version is the version of getty, current-time is the time when you compile the code. // please replace your_version and current-time with the real version and time. $ cd target/darwin/rpc_server-${your-version}-${current-time}-test/ && sh bin/load_rpc_server.sh start -$ cd rpc/client/ && sh assembly/mac/test.sh +$ cd rpc/client/ && sh assembly/Mac/test.sh // your_version is the version of getty, current-time is the time when you compile the code. // please replace your_version and current-time with the real version and time. -cd target/darwin/rpc_client-${your-version}-${current-time}-test/ && sh bin/load_rpc_client.sh start +$ cd target/darwin/rpc_client-${your-version}-${current-time}-test/ && sh bin/load_rpc_client.sh start
134-142
: Fix Mac capitalization for consistencySimilar to the previous section, "mac" should be capitalized as "Mac".
-$ cd micro/server/ && sh assembly/mac/test.sh +$ cd micro/server/ && sh assembly/Mac/test.sh -$ cd micro/client/ && sh assembly/mac/test.sh +$ cd micro/client/ && sh assembly/Mac/test.sh
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
readme.md
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
readme.md
[grammar] ~94-~94: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
[grammar] ~131-~131: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
🔇 Additional comments (1)
readme.md (1)
Line range hint 22-142
: Documentation changes look good overall!
The changes successfully address the command issues by:
- Introducing version and timestamp placeholders for flexibility
- Maintaining consistent structure across all examples
- Providing clear instructions for both Linux and macOS users
The documentation is now more maintainable and easier to follow.
🧰 Tools
🪛 LanguageTool
[grammar] ~94-~94: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (4)
readme.md (4)
22-25
: Enhance placeholder documentation with examplesThe placeholder instructions could be more helpful with concrete examples and clearer guidance:
// your_version is the version of getty, current-time is the time when you compile the code. // please replace your_version and current-time with the real version and time. +// Example: If getty version is v1.2.3 and compile time is 20240115, use: +// target/linux/echo_server-v1.2.3-20240115-test/Also consider using shell-style variables for consistency:
-echo_server-${your-version}-${current-time}-test/ +echo_server-${GETTY_VERSION}-${BUILD_TIME}-test/Also applies to: 31-34
Line range hint
65-67
: Enhance WebSocket JS client documentationThe JavaScript client instructions need more details for proper setup:
-$ cd echo/ws-echo/js-client/ && open index.html in a internet browser(like chrome or ie or firefox etc). +$ cd echo/ws-echo/js-client/ + +# Open index.html in a modern web browser (Chrome, Firefox, Safari, Edge) +# Default WebSocket connection URL: ws://localhost:8090/echo +# Note: Ensure the server is running before connecting the client + +# Troubleshooting: +# - Check browser console (F12) for connection errors +# - Verify server is running and port is accessible +# - Ensure no firewall is blocking WebSocket connections
97-105
: Improve platform-specific documentation
- Use proper capitalization for "Mac"
- Consider consolidating platform-specific instructions
-$ cd rpc/server/ && sh assembly/mac/test.sh +$ cd rpc/server/ && sh assembly/mac/test.sh + +# Platform-specific paths: +# - Linux: target/linux/rpc_server-* +# - macOS: target/darwin/rpc_server-* + +# Choose the appropriate command based on your OS: // your_version is the version of getty, current-time is the time when you compile the code. // please replace your_version and current-time with the real version and time. -$ cd target/darwin/rpc_server-${your-version}-${current-time}-test/ && sh bin/load_rpc_server.sh start
Line range hint
1-3
: Enhance overall document structureConsider adding these sections to improve documentation usability:
# getty examples ## --- *[getty](https://github.com/alexstocks/getty) code examples* + +## Table of Contents +- [Prerequisites](#prerequisites) +- [Examples](#examples) + - [TCP Echo](#getty-example1-tcp-echo) + - [WebSocket Echo](#getty-example2-ws-echo) + - [RPC](#getty-example3-rpc) + - [Micro](#getty-example4-micro) +- [Troubleshooting](#troubleshooting) + +## Prerequisites +- Go 1.x or higher +- Git +- Make (for building) +- Service registry (for micro example) + +## Troubleshooting +- Common issues and solutions +- How to report bugs +- Where to get help
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
readme.md
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
readme.md
[grammar] ~94-~94: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
[grammar] ~131-~131: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
readme.md
Outdated
To run the example on linux, start the server: | ||
|
||
```bash | ||
$ cd micro/server/ && sh assembly/linux/test.sh && cd target/linux/micro_server-0.9.2-20180806-1559-test/ && sh bin/load.sh start | ||
$ cd micro/server/ && sh assembly/linux/test.sh | ||
// your_version is the version of getty, current-time is the time when you compile the code. | ||
// please replace your_version and current-time with the real version and time. | ||
$ cd target/linux/micro_server-${your-version}-${current-time}-test/ && sh bin/load_micro_server.sh start |
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.
🛠️ Refactor suggestion
Add missing micro service configuration details
The micro service example needs additional documentation about service registration and discovery:
This example shows how to build micro client and server to do service registration and service discovery based on rpc.
+
+# Prerequisites:
+# - Service registry (e.g., etcd, consul) must be running
+# - Default registry endpoint: localhost:2379
+
+# Configuration:
+# - Service name: com.ikurento.user
+# - Default port: 8090
+# - Registry type: etcd
+
+# Service Discovery:
+# - Services are automatically registered on startup
+# - Client discovers services through the registry
+# - Health checks are performed every 60s
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
To run the example on linux, start the server: | |
```bash | |
$ cd micro/server/ && sh assembly/linux/test.sh && cd target/linux/micro_server-0.9.2-20180806-1559-test/ && sh bin/load.sh start | |
$ cd micro/server/ && sh assembly/linux/test.sh | |
// your_version is the version of getty, current-time is the time when you compile the code. | |
// please replace your_version and current-time with the real version and time. | |
$ cd target/linux/micro_server-${your-version}-${current-time}-test/ && sh bin/load_micro_server.sh start | |
To run the example on linux, start the server: | |
```bash | |
$ cd micro/server/ && sh assembly/linux/test.sh | |
// your_version is the version of getty, current-time is the time when you compile the code. | |
// please replace your_version and current-time with the real version and time. | |
$ cd target/linux/micro_server-${your-version}-${current-time}-test/ && sh bin/load_micro_server.sh start | |
``` | |
This example shows how to build micro client and server to do service registration and service discovery based on rpc. | |
# Prerequisites: | |
# - Service registry (e.g., etcd, consul) must be running | |
# - Default registry endpoint: localhost:2379 | |
# Configuration: | |
# - Service name: com.ikurento.user | |
# - Default port: 8090 | |
# - Registry type: etcd | |
# Service Discovery: | |
# - Services are automatically registered on startup | |
# - Client discovers services through the registry | |
# - Health checks are performed every 60s |
readme.md
Outdated
``` | ||
|
||
Next, start the client: | ||
|
||
```bash | ||
$ cd echo/tcp-echo/client/ && sh assembly/linux/test.sh && cd target/linux/echo_client-0.3.07-20161009-1634-test/ && sh bin/load.sh start | ||
$ cd echo/tcp-echo/client/ && sh assembly/linux/test.sh | ||
// your_version is the version of getty, current-time is the time when you compile the code. |
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
is not the getty version, but the version set in version.go(eg:echo/tcp-echo/client/app/version.go), which means your build artifacts version, default is 1.0.0.
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.
ok, i will change it
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.
@No-SilverBullet done
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.
@No-SilverBullet done
Cool, LGTM; @AlexStocks pls check this pr
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
readme.md (2)
22-25
: LGTM! Consider enhancing version.go location clarity.The command instructions are now correctly using placeholders. However, to make it even clearer for users, consider adding the specific path to version.go.
-// your_version is the version set in version.go +// your_version is the version set in app/version.go (e.g., echo/tcp-echo/server/app/version.go)Also applies to: 31-34
97-97
: Capitalize "Mac" for consistency with Apple branding.For better documentation quality:
-$ cd rpc/server/ && sh assembly/mac/test.sh +$ cd rpc/server/ && sh assembly/Mac/test.sh -$ cd rpc/client/ && sh assembly/mac/test.sh +$ cd rpc/client/ && sh assembly/Mac/test.shAlso applies to: 102-102
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
readme.md
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
readme.md
[grammar] ~94-~94: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
[grammar] ~131-~131: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...What's more, if you run this example on mac, the server compile command should be: ...
(APPLE_PRODUCTS)
🔇 Additional comments (2)
readme.md (2)
47-50
: LGTM! Consistent with TCP echo section.
Also applies to: 56-59
114-115
: Add missing micro service configuration details.
The micro service example would benefit from additional configuration details as suggested in the previous review. This information is crucial for users to successfully run the example.
Let me verify if the configuration details exist elsewhere:
#!/bin/bash
# Search for configuration details in micro example documentation
rg -g '!target/' -g '*.{md,txt}' -i "service.*configuration|registry.*endpoint|service.*discovery" micro/
Fix the cmd that failed to run.
Summary by CodeRabbit
readme.md
for running examples, replacing specific version numbers and timestamps with placeholders for improved flexibility.