-
Notifications
You must be signed in to change notification settings - Fork 61
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: Add custom command to cluster client #2803
base: main
Are you sure you want to change the base?
Go: Add custom command to cluster client #2803
Conversation
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
go/api/glide_client.go
Outdated
// This function should only be used for single-response commands. Commands that don't return complete response and awaits | ||
// (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the client's | ||
// behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function. | ||
// | ||
// For example, to return a list of all pub/sub clients: | ||
// | ||
// client.CustomCommand([]string{"CLIENT", "LIST","TYPE", "PUBSUB"}) | ||
// result, err := client.CustomCommand([]string{"CLIENT", "LIST", "TYPE", "PUBSUB"}) |
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.
example should include the result
output, no?
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.
Should I update this for other clients as well?
// result.(string): "PONG" | ||
// | ||
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command | ||
func (client *GlideClusterClient) CustomCommand(args []string) (interface{}, error) { |
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 we want to handle the ClusterResponse
support here? Ref: https://github.com/valkey-io/valkey-glide/blob/main/java/client/src/main/java/glide/api/commands/GenericClusterCommands.java#L37
No description provided.