From e766dd75ae23b96e9046da2799320d20d50a7625 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Fri, 15 Jul 2016 13:06:11 -0700 Subject: [PATCH] added EXPIRES, PERSISTS, TTL, and EX keyword --- core/commands.json | 61 +++++++++++++++++++++++++++++++++++++++++++- core/commands_gen.go | 61 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/core/commands.json b/core/commands.json index 75791672..135b6e34 100644 --- a/core/commands.json +++ b/core/commands.json @@ -19,7 +19,14 @@ "multiple": true }, { - "name": "value", + "command": "EX", + "name": ["seconds", "value"], + "type": ["string", "double"], + "optional": true, + "multiple": false + }, + { + "name": "value", "enumargs": [ { "name": "OBJECT", @@ -93,6 +100,58 @@ "since": "1.0.0", "group": "keys" }, + "EXPIRE": { + "summary": "Set a timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + }, + { + "name": "seconds", + "type": "double" + } + ], + "since": "1.0.0", + "group": "keys" + }, + "TTL": { + "summary": "Get a timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + } + ], + "since": "1.0.0", + "group": "keys" + }, + "PERSIST": { + "summary": "Remove the existing timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + } + ], + "since": "1.0.0", + "group": "keys" + }, "FSET": { "summary": "Set the value for a single field of an id", "complexity": "O(1)", diff --git a/core/commands_gen.go b/core/commands_gen.go index 3a68e3ba..8e9a4fee 100644 --- a/core/commands_gen.go +++ b/core/commands_gen.go @@ -181,7 +181,14 @@ var commandsJSON = `{ "multiple": true }, { - "name": "value", + "command": "EX", + "name": ["seconds", "value"], + "type": ["string", "double"], + "optional": true, + "multiple": false + }, + { + "name": "value", "enumargs": [ { "name": "OBJECT", @@ -255,6 +262,58 @@ var commandsJSON = `{ "since": "1.0.0", "group": "keys" }, + "EXPIRE": { + "summary": "Set a timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + }, + { + "name": "seconds", + "type": "double" + } + ], + "since": "1.0.0", + "group": "keys" + }, + "TTL": { + "summary": "Get a timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + } + ], + "since": "1.0.0", + "group": "keys" + }, + "PERSIST": { + "summary": "Remove the existing timeout on an id", + "complexity": "O(1)", + "arguments":[ + { + "name": "key", + "type": "string" + }, + { + "name": "id", + "type": "string" + } + ], + "since": "1.0.0", + "group": "keys" + }, "FSET": { "summary": "Set the value for a single field of an id", "complexity": "O(1)",