-
Notifications
You must be signed in to change notification settings - Fork 70
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
Go: Implementing PING command #2264
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -692,3 +692,37 @@ type HashCommands interface { | |
// [valkey.io]: https://valkey.io/commands/hstrlen/ | ||
HStrLen(key string, field string) (Result[int64], error) | ||
} | ||
|
||
// ConnectionManagementCommands defines an interface for connection management-related commands. | ||
// | ||
// See [valkey.io] for details. | ||
type ConnectionManagementCommands interface { | ||
// Pings the server. | ||
// | ||
// If no argument is provided, returns "PONG". If a message is provided, returns the message. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have two separate implementations of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
and for cluster client
|
||
// | ||
// Return value: | ||
// If no argument is provided, returns "PONG". | ||
// If an argument is provided, returns the argument. | ||
// | ||
// For example: | ||
// result, err := client.Ping("Hello") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
// | ||
// [valkey.io]: https://valkey.io/commands/ping/ | ||
Ping() (string, error) | ||
|
||
// Pings the server with a custom message. | ||
// | ||
// If a message is provided, returns the message. | ||
// If no argument is provided, returns "PONG". | ||
// | ||
// Return value: | ||
// If no argument is provided, returns "PONG". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to not provide an argument in this method? |
||
// If an argument is provided, returns the argument. | ||
// | ||
// For example: | ||
// result, err := client.PingWithMessage("Hello") | ||
// | ||
// [valkey.io]: https://valkey.io/commands/ping/ | ||
PingWithMessage(message string) (string, error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are golang docstrings propagated to all API in such case? If no or you'r not sure - please duplicate docs for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can check it with a doc generator. |
||
} |
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.
I think we should return Result[string] from all the methods to keep it consistent and pass the nil string info if an error has occurred. Can you please address this in another PR?