valkey-io / valkey-go

A fast Golang Valkey client that supports Client Side Caching and Auto Pipelining.
Apache License 2.0
157 stars 10 forks source link

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

Closed rueian closed 2 months ago

rueian commented 3 months ago

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:

New command options:

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-commenter commented 3 months ago

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 ```diff @@ 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.

rueian commented 2 months ago

Merged in v1.0.46.