summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorIgor Malinovskiy <u.glide@gmail.com>2023-03-22 07:17:20 +0100
committerGitHub <noreply@github.com>2023-03-22 08:17:20 +0200
commitc3b9f2fbd9085f4c9ea3151cc88d3b31c0d30b91 (patch)
tree68c2a78c10cd59274aa7d0a24d9ea137805d0415 /src/commands
parent6948dacaf63415c6cabce207cd7d23dcb37dd5e1 (diff)
downloadredis-c3b9f2fbd9085f4c9ea3151cc88d3b31c0d30b91.tar.gz
Allow clients to report name and version (#11758)
This PR allows clients to send information about the client library to redis to be displayed in CLIENT LIST and CLIENT INFO. Currently supports: `CLIENT [lib-name | lib-ver] <value>` Client libraries are expected to pipeline these right after AUTH, and ignore the failure in case they're talking to an older version of redis. These will be shown in CLIENT LIST and CLIENT INFO as: * `lib-name` - meant to hold the client library name. * `lib-ver` - meant to hold the client library version. The values cannot contain spaces, newlines and any wild ASCII characters, but all other normal chars are accepted, e.g `.`, `=` etc (same as CLIENT NAME). The RESET command does NOT clear these, but they can be cleared to the default by sending a command with a blank string. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/client-setinfo.json41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/commands/client-setinfo.json b/src/commands/client-setinfo.json
new file mode 100644
index 000000000..426ff4d28
--- /dev/null
+++ b/src/commands/client-setinfo.json
@@ -0,0 +1,41 @@
+{
+ "SETINFO": {
+ "summary": "Set client or connection specific info",
+ "complexity": "O(1)",
+ "group": "connection",
+ "since": "7.2.0",
+ "arity": 4,
+ "container": "CLIENT",
+ "function": "clientSetinfoCommand",
+ "command_flags": [
+ "NOSCRIPT",
+ "LOADING",
+ "STALE",
+ "SENTINEL"
+ ],
+ "acl_categories": [
+ "CONNECTION"
+ ],
+ "reply_schema": {
+ "const": "OK"
+ },
+ "arguments": [
+ {
+ "name": "attr",
+ "type": "oneof",
+ "arguments": [
+ {
+ "token": "lib-name",
+ "name": "libname",
+ "type": "string"
+ },
+ {
+ "token": "lib-ver",
+ "name": "libver",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ }
+}