Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
Signed-off-by: TJ Zhang <[email protected]>
  • Loading branch information
TJ Zhang committed Jan 15, 2025
1 parent 3821541 commit acf2e49
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions go/api/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1643,15 +1643,17 @@ func (client *baseClient) XLen(key string) (int64, error) {
//
// Example:
//
// // assume "key" contains a set
// resCursor, resCol, err := client.ZScan("key", "0")
// for resCursor != "0" {
// resCursor, resCol, err = client.ZScan("key", "0")
// fmt.Println("Cursor: ", resCursor.Value())
// fmt.Println("Members: ", resCol.Value())
// }
// // assume "key" contains a set
// resCursor, resCol, err := client.ZScan("key", "0")
// fmt.Println(resCursor.Value())
// fmt.Println(resCol.Value())
// for resCursor != "0" {
// resCursor, resCol, err = client.ZScan("key", "0")
// fmt.Println("Cursor: ", resCursor.Value())
// fmt.Println("Members: ", resCol.Value())
// }
//
// [valkey.io]: https://valkey.io/commands/sscan/
// [valkey.io]: https://valkey.io/commands/zscan/
func (client *baseClient) ZScan(key string, cursor string) (Result[string], []Result[string], error) {
result, err := client.executeCommand(C.ZScan, []string{key, cursor})
if err != nil {
Expand Down Expand Up @@ -1681,13 +1683,15 @@ func (client *baseClient) ZScan(key string, cursor string) (Result[string], []Re
// Example:
//
// resCursor, resCol, err := client.ZScanWithOptions("key", "0", options.NewBaseScanOptionsBuilder().SetMatch("*"))
// fmt.Println(resCursor.Value())
// fmt.Println(resCol.Value())
// for resCursor != "0" {
// resCursor, resCol, err = client.ZScanWithOptions("key", "0", options.NewBaseScanOptionsBuilder().SetMatch("*"))
// fmt.Println("Cursor: ", resCursor.Value())
// fmt.Println("Members: ", resCol.Value())
// }
//
// [valkey.io]: https://valkey.io/commands/sscan/
// [valkey.io]: https://valkey.io/commands/zscan/
func (client *baseClient) ZScanWithOptions(
key string,
cursor string,
Expand Down

0 comments on commit acf2e49

Please sign in to comment.