summaryrefslogtreecommitdiffstats
path: root/src/commands/bitfield.json
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/bitfield.json')
-rw-r--r--src/commands/bitfield.json159
1 files changed, 159 insertions, 0 deletions
diff --git a/src/commands/bitfield.json b/src/commands/bitfield.json
new file mode 100644
index 0000000..843cea8
--- /dev/null
+++ b/src/commands/bitfield.json
@@ -0,0 +1,159 @@
+{
+ "BITFIELD": {
+ "summary": "Performs arbitrary bitfield integer operations on strings.",
+ "complexity": "O(1) for each subcommand specified",
+ "group": "bitmap",
+ "since": "3.2.0",
+ "arity": -2,
+ "function": "bitfieldCommand",
+ "get_keys_function": "bitfieldGetKeys",
+ "command_flags": [
+ "WRITE",
+ "DENYOOM"
+ ],
+ "acl_categories": [
+ "BITMAP"
+ ],
+ "key_specs": [
+ {
+ "notes": "This command allows both access and modification of the key",
+ "flags": [
+ "RW",
+ "UPDATE",
+ "ACCESS",
+ "VARIABLE_FLAGS"
+ ],
+ "begin_search": {
+ "index": {
+ "pos": 1
+ }
+ },
+ "find_keys": {
+ "range": {
+ "lastkey": 0,
+ "step": 1,
+ "limit": 0
+ }
+ }
+ }
+ ],
+ "arguments": [
+ {
+ "name": "key",
+ "type": "key",
+ "key_spec_index": 0
+ },
+ {
+ "name": "operation",
+ "type": "oneof",
+ "multiple": true,
+ "optional": true,
+ "arguments": [
+ {
+ "token": "GET",
+ "name": "get-block",
+ "type": "block",
+ "arguments": [
+ {
+ "name": "encoding",
+ "type": "string"
+ },
+ {
+ "name": "offset",
+ "type": "integer"
+ }
+ ]
+ },
+ {
+ "name": "write",
+ "type": "block",
+ "arguments": [
+ {
+ "token": "OVERFLOW",
+ "name": "overflow-block",
+ "type": "oneof",
+ "optional": true,
+ "arguments": [
+ {
+ "name": "wrap",
+ "type": "pure-token",
+ "token": "WRAP"
+ },
+ {
+ "name": "sat",
+ "type": "pure-token",
+ "token": "SAT"
+ },
+ {
+ "name": "fail",
+ "type": "pure-token",
+ "token": "FAIL"
+ }
+ ]
+ },
+ {
+ "name": "write-operation",
+ "type": "oneof",
+ "arguments": [
+ {
+ "token": "SET",
+ "name": "set-block",
+ "type": "block",
+ "arguments": [
+ {
+ "name": "encoding",
+ "type": "string"
+ },
+ {
+ "name": "offset",
+ "type": "integer"
+ },
+ {
+ "name": "value",
+ "type": "integer"
+ }
+ ]
+ },
+ {
+ "token": "INCRBY",
+ "name": "incrby-block",
+ "type": "block",
+ "arguments": [
+ {
+ "name": "encoding",
+ "type": "string"
+ },
+ {
+ "name": "offset",
+ "type": "integer"
+ },
+ {
+ "name": "increment",
+ "type": "integer"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "reply_schema": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "description": "The result of the subcommand at the same position",
+ "type": "integer"
+ },
+ {
+ "description": "In case OVERFLOW FAIL was given and overflows or underflows detected",
+ "type": "null"
+ }
+ ]
+ }
+ }
+ }
+}