You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Features
10
10
- Very compatible with any `redis client` including `redis-cli`
11
11
- Standalone with no external dependencies
12
12
- Helpers commands for `Time`, `Encode <hex|md5|sha1|sha256|sha512> <payload>`, `RANDINT`, `RANDSTR`
13
+
- Implements `RATELIMIT` helpers natively.
13
14
14
15
Why
15
16
===
@@ -100,7 +101,9 @@ Supported Commands
100
101
-`DEL <key1> [<key2> ...]`
101
102
-`EXISTS <key>`
102
103
-`INCR <key> [<by>]`
103
-
-`TTL <key>` returns `-1` if key will never expire, `-2` if it doesn't exists (expired), other wise will returns the `seconds` remain before the key will expire.
104
+
-`TTL <key>` returns `-1` if key will never expire, `-2` if it doesn't exists (expired), otherwise will returns the `seconds` remain before the key will expire.
105
+
-`KEYS [<regexp-pattern>]`
106
+
104
107
105
108
## # HASHES
106
109
> I enhanced the HASH MAP implementation and added some features like TTL per nested key,
@@ -116,6 +119,7 @@ Supported Commands
116
119
-`HEXISTS <HASHMAP> [<key>]`.
117
120
-`HINCR <HASHMAP> <key> [<by>]`
118
121
-`HTTL <HASHMAP> <key>`, the same as `TTL` but for `HASHMAP`
122
+
-`HKEYS <HASHMAP>`
119
123
120
124
## # LIST
121
125
> I applied a new concept, you can push or push-unique values into the list,
@@ -146,6 +150,11 @@ Supported Commands
146
150
-`WEBSOCKETOPEN <channel>`, opens a websocket endpoint and returns its id, so you can receive updates through `ws://server.address:port/stream/ws/{generated_id_here}`
147
151
-`WEBSOCKETCLOSE <ID>`, closes the specified websocket endpoint using the above generated id.
148
152
153
+
## # Ratelimit
154
+
-`RATELIMITSET <bucket> <limit> <seconds>`, create a new `$bucket` that accepts num of `$limit` of actions per the specified num of `$seconds`, it will returns `1` for success.
155
+
-`RATELIMITTAKE <bucket>`, do an action in the specified `bucket` and take an item from it, it will return `-1` if the bucket not exists or it has unlimited actions `$limit < 1`, `0` if there are no more actions to be done right now, `reminder` of actions on success.
156
+
-`RATELIMITGET <bucket>`, returns array [`$limit`, `$seconds`, `$remaining_time`, `$counter`] information for the specified bucket
157
+
149
158
## # Utils
150
159
> a helpers commands
151
160
@@ -157,6 +166,8 @@ Supported Commands
157
166
-`TIME`, returns the current time in `utc`, `seconds` and `nanoseconds`
0 commit comments