valkey-go icon indicating copy to clipboard operation
valkey-go copied to clipboard

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

Open rueian opened this issue 1 year ago • 1 comments

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())
}

rueian avatar Aug 12 '24 12:08 rueian

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Aug 12 '24 12:08 codecov-commenter

Merged in v1.0.46.

rueian avatar Sep 17 '24 01:09 rueian