valkey-go
valkey-go copied to clipboard
feat: add SCRIPT SHOW, CLIENT CAPA, and CLUSTER SLOT-STATS commands
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())
}
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.
Merged in v1.0.46.