Skip to content

Add support for CLIENT SETINFO #2553

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ type Cmdable interface {
ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
ClientList(ctx context.Context) *StringCmd
ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
ClientSetInfo(ctx context.Context, libName, libVersion string) *StatusCmd
ClientUnpause(ctx context.Context) *BoolCmd
ClientID(ctx context.Context) *IntCmd
ClientUnblock(ctx context.Context, id int64) *IntCmd
Expand Down Expand Up @@ -3150,6 +3151,22 @@ func (c cmdable) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd {
return cmd
}

func (c cmdable) ClientSetInfo(ctx context.Context, libName, libVersion string) *StatusCmd {
args := []interface{}{"client", "setinfo"}
if libName != "" {
args = append(args, "lib-name", libName)
}
if libVersion != "" {
args = append(args, "lib-ver", libVersion)
}
cmd := NewStatusCmd(ctx, args...)
if libName == "" && libVersion == "" {
cmd.SetErr(errors.New("libName and/or libVersion must be provided"))
}
_ = c(ctx, cmd)
return cmd
}

func (c cmdable) ClientUnpause(ctx context.Context) *BoolCmd {
cmd := NewBoolCmd(ctx, "client", "unpause")
_ = c(ctx, cmd)
Expand Down