-
Notifications
You must be signed in to change notification settings - Fork 69
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: Implement Config Rewrite #3156
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: EdricCua <[email protected]>
// | ||
// "OK" when the configuration was rewritten properly, otherwise an error is thrown. | ||
// | ||
// Example: |
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.
Examples should not exist in the document block and instead should be placed in the relevant test file. See the Go Developer Guide for Valkey-Glide.
// | ||
// "OK" when the configuration was rewritten properly, otherwise an error is thrown. | ||
// | ||
// Example: |
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.
Examples should not exist in the document block and instead should be placed in the relevant test file. See the Go Developer Guide for Valkey-Glide.
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.
- Need to move examples to the corresponding file(s).
- Need to add a changelog entry as of now.
RouteOption
was reworked in 1.3 branch.
Please wait for backporting all changes from release-1.3
branch. You can merge/rebase you branch after that and implement required fixes.
// fmt.Println(response) // Output: OK | ||
// | ||
// [valkey.io]: https://valkey.io/commands/config-rewrite/ | ||
func (client *GlideClusterClient) ConfigRewriteWithOptions(opts options.RouteOption) (string, 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.
Need an implementation without route. Route is mandatory there.
@@ -372,3 +372,34 @@ func (client *GlideClusterClient) EchoWithOptions(echoOptions options.ClusterEch | |||
} | |||
return createClusterSingleValue[string](data), nil | |||
} | |||
|
|||
// Rewrites the configuration file with the current configuration. | |||
// The command will be routed a random node, unless `Route` in `routeOptions` is provided. |
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.
This line should be in the API which has no route argument:
// The command will be routed a random node.
@@ -298,3 +298,21 @@ func (suite *GlideTestSuite) TestEchoCluster() { | |||
assert.Contains(t, strings.ToLower(messages), strings.ToLower("hello")) | |||
} | |||
} | |||
|
|||
func (suite *GlideTestSuite) TestConfigRewriteWithOptions() { |
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.
Need a test for standalone client too.
Issue link
This Pull Request is linked to issue (URL): [REPLACE ME]
Checklist
Before submitting the PR make sure the following are checked: