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

feat: add SCRIPT SHOW, CLIENT CAPA, and CLUSTER SLOT-STATS commands #13

Closed
wants to merge 1 commit into from

Conversation

rueian
Copy link
Collaborator

@rueian rueian commented Aug 12, 2024

This PR shows how to generate new Valkey commands and new command options by adding them into the commands.json and running go generate.

New commands:

  • CLUSTER SLOT-STATS
  • CLIENT CAPA
  • SCRIPT SHOW

New command options:

  • TIMEOUT -> CLUSTER SETSLOT
  • NOSCORES -> ZSCAN

Example usage:

package main

import (
	"context"
	"fmt"
	"github.com/valkey-io/valkey-go"
)

func main() {
	client, err := valkey.NewClient(valkey.ClientOption{InitAddress: []string{"127.0.0.1:6379"}})
	if err != nil {
		panic(err)
	}
	defer client.Close()

	cmd := client.B().ClusterSlotStats().Slotsrange().StartSlot(0).EndSlot(1000).Build()
	fmt.Println(client.Do(context.Background(), cmd).ToAny())
}

Signed-off-by: Rueian <rueiancsie@gmail.com>
@rueian rueian force-pushed the valkey-8-commands branch from 0f179d0 to 020b06e Compare August 12, 2024 12:35
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.66%. Comparing base (f41a9e9) to head (020b06e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   89.62%   89.66%   +0.03%     
==========================================
  Files          87       87              
  Lines       36949    37051     +102     
==========================================
+ Hits        33117    33220     +103     
+ Misses       3648     3647       -1     
  Partials      184      184              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rueian
Copy link
Collaborator Author

rueian commented Sep 17, 2024

Merged in v1.0.46.

@rueian rueian closed this Sep 17, 2024
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.

2 participants