Skip to content
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 List commands #2370

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

janhavigupta007
Copy link
Collaborator

@janhavigupta007 janhavigupta007 commented Sep 30, 2024

Implementing the following List commands:

  • LPUSH
  • LPOP, LPOP count
  • LPOS, LPOS with options, LPOS count, LPOS count with options
  • RPUSH

Signed-off-by: Janhavi Gupta <janhavigupta@google.com>
@janhavigupta007 janhavigupta007 requested a review from a team as a code owner September 30, 2024 05:33
@janhavigupta007 janhavigupta007 self-assigned this Sep 30, 2024
@janhavigupta007 janhavigupta007 added the go golang wrapper label Sep 30, 2024
@eifrah-aws eifrah-aws self-requested a review October 1, 2024 09:01
//
// Return value:
// The Result[string] containing the value of the first element.
// If key does not exist, [api.CreateNilStringResult()] will be returned.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If key does not exist, [api.CreateNilStringResult()] will be returned.
// If key does not exist, `nil` will be returned.

For the end user it does not matter where null comes from. We should describe what returned and when.

Copy link
Collaborator Author

@janhavigupta007 janhavigupta007 Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the api.CreateNilStringResult() is returning nil object, whereas it's returning api.Result[string]{val: "", isNil: true} object. To not make it too verbose, we decided to replace it with a function and link in the docs.

Please let me know if you think otherwise. Going ahead with the merge for now, I can address any change required in the next PR.

go/api/list_commands.go Show resolved Hide resolved
go/integTest/shared_commands_test.go Show resolved Hide resolved
go/api/command_options.go Show resolved Hide resolved
@janhavigupta007 janhavigupta007 merged commit 1496c84 into valkey-io:main Oct 3, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go golang wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants