forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request valkey-io#2294 from MikeMwita/implement-del-command
Go: Implementing DEL command
- Loading branch information
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 | ||
|
||
package api | ||
|
||
// Supports commands and transactions for the "List Commands" group for standalone and cluster clients. | ||
// | ||
// See [valkey.io] for details. | ||
// | ||
// GenericBaseCommands defines an interface for the "Generic Commands". | ||
// | ||
// [valkey.io]: https://valkey.io/commands/?group=Generic | ||
type GenericBaseCommands interface { | ||
// Del removes the specified keys from the database. A key is ignored if it does not exist. | ||
// | ||
// Note: | ||
//When in cluster mode, the command may route to multiple nodes when `keys` map to different hash slots. | ||
// | ||
// Parameters: | ||
// keys - One or more keys to delete. | ||
// | ||
// Return value: | ||
// Returns the number of keys that were removed. | ||
// | ||
// Example: | ||
// result, err := client.Del([]string{"key1", "key2", "key3"}) | ||
// if err != nil { | ||
// // handle error | ||
// } | ||
// fmt.Println(result) // Output: 2 | ||
// | ||
// [valkey.io]: https://valkey.io/commands/del/ | ||
Del(keys []string) (Result[int64], error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters