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

Add: Support for COMMAND LIST command #2491

Merged
merged 10 commits into from Mar 19, 2023

Conversation

SoulPancake
Copy link
Contributor

Fixes #2389

@SoulPancake SoulPancake marked this pull request as ready for review March 19, 2023 08:05
@SoulPancake
Copy link
Contributor Author

@monkey92t @chayim Can you please review this?

command.go Outdated Show resolved Hide resolved
commands.go Outdated Show resolved Hide resolved
command.go Outdated Show resolved Hide resolved
@monkey92t
Copy link
Collaborator

Maybe we can use the shortcut API

CommandList(ctx) []string
CommandListByModel(ctx, modelName) []string
CommandListByACLCat...
CommandListByPattern...

@SoulPancake
Copy link
Contributor Author

Hmm, We can do that as well
But this seems more elegant to me, as the reply types are pretty same so having a filterBy opt seems better
Whatever you decide

@monkey92t
Copy link
Collaborator

It seems better to use pointers:

CommandList(ctx context.Context, opt *FilterBy) *StringSliceCmd

client.CommandList(ctx, &redis.FilterBy{...})
client.CommandList(ctx, nil)

OR

CommandList(ctx context.Context, opt FilterBy) *StringSliceCmd

client.CommandList(ctx, redis.FilterBy{...})
client.CommandList(ctx, redis.FilterBy{})

@monkey92t
Copy link
Collaborator

I vote for the pointer...

commands.go Outdated Show resolved Hide resolved
commands_test.go Outdated Show resolved Hide resolved
commands.go Outdated Show resolved Hide resolved
@monkey92t
Copy link
Collaborator

Overall it looks good~

commands.go Outdated Show resolved Hide resolved
@monkey92t monkey92t merged commit 049d4f9 into redis:master Mar 19, 2023
3 checks passed
@monkey92t
Copy link
Collaborator

:)

@SoulPancake
Copy link
Contributor Author

Thanks @monkey92t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for COMMAND LIST command
2 participants