Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76b2bd7f6b |
@@ -1,60 +1,20 @@
|
||||
# redis
|
||||
|
||||
A Redis client library for Carp, supporting Redis 7.x.
|
||||
is a Redis client library for Carp.
|
||||
|
||||
## Installation
|
||||
|
||||
```clojure
|
||||
(load "https://git.veitheller.de/carpentry/redis.git@master")
|
||||
(load "https://veitheller.de/git/carpentry/redis.git@master")
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```clojure
|
||||
(load "redis.carp")
|
||||
This package contains functions to convert to and from the Redis protocol,
|
||||
and handling Redis connections and commands. The documentation lives
|
||||
[here](https://veitheller.de/redis).
|
||||
|
||||
(defn main []
|
||||
(match (Redis.open "127.0.0.1")
|
||||
(Result.Success r)
|
||||
(do
|
||||
(println* &(Redis.ping &r))
|
||||
(println* &(Redis.set &r @"key" @"value"))
|
||||
(println* &(Redis.get &r @"key"))
|
||||
|
||||
; list operations return nested RESP arrays
|
||||
(println* &(Redis.rpush &r @"mylist" @"a"))
|
||||
(println* &(Redis.rpush &r @"mylist" @"b"))
|
||||
(println* &(Redis.lrange &r @"mylist" @"0" @"-1"))
|
||||
|
||||
; pattern match on responses
|
||||
(match (Redis.get &r @"key")
|
||||
(Result.Success resp)
|
||||
(match resp
|
||||
(RESP.Str s) (println* "got: " &s)
|
||||
(RESP.Null) (println* "key not found")
|
||||
_ (println* "unexpected type"))
|
||||
(Result.Error e) (println* "error: " &e))
|
||||
|
||||
(Redis.close r))
|
||||
(Result.Error err) (IO.errorln &err)))
|
||||
```
|
||||
|
||||
The library provides thin wrappers around all standard Redis commands through
|
||||
7.2, so you can call them directly (e.g. `Redis.get`, `Redis.hset`,
|
||||
`Redis.lrange`). For commands with complex or variadic arguments, use
|
||||
`Redis.send` directly:
|
||||
|
||||
```clojure
|
||||
(Redis.send &r @"SET" &[(to-redis @"key") (to-redis @"value")])
|
||||
(Redis.read &r)
|
||||
```
|
||||
|
||||
The RESP type supports recursive arrays via `Box`, so nested structures
|
||||
(e.g. from `XRANGE` or `COMMAND`) are decoded faithfully.
|
||||
|
||||
Full API documentation lives [here](https://veitheller.de/redis).
|
||||
|
||||
More examples are in the [`examples`](./examples) directory.
|
||||
You can also look at the examples in the [`examples`](./examples) directory.
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
+6
-28
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<div class="content">
|
||||
<div class="logo">
|
||||
<a href="https://git.veitheller.de/carpentry/redis">
|
||||
<a href="https://veitheller/git/carpentry/redis">
|
||||
<img src="">
|
||||
</a>
|
||||
<div class="title">
|
||||
@@ -30,16 +30,15 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="module">
|
||||
<h1>
|
||||
RESP
|
||||
</h1>
|
||||
<div class="module-description">
|
||||
<p>is a wrapper around the <a href="https://redis.io/topics/protocol">Redis Serialization
|
||||
Protocol</a>. You can create all types,
|
||||
stringify the built types into strings using <a href="#str"><code>str</code></a>, and decode from
|
||||
the string protocol using <a href="#from-string"><code>from-string</code></a>. Arrays are fully
|
||||
supported, including nested arrays.</p>
|
||||
Protocol</a>. You can create all types—though
|
||||
creating arrays is a little unsightly due to the absence of recursive types—,
|
||||
stringify the built types into strings using <a href="#str"><code>str</code></a>, and decoding from
|
||||
the string protocol using <a href="#from-string"><code>from-string</code></a>.</p>
|
||||
<p>If you want your types to be supported when encoding, you’ll have to implement
|
||||
the interface <code>to-redis</code>, the signature of which is <code>(Fn [a] RESP))</code>.</p>
|
||||
|
||||
@@ -54,7 +53,7 @@ the interface <code>to-redis</code>, the signature of which is <code>(Fn [a] RES
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [(Array (Box RESP))] RESP)
|
||||
(Fn [(Array String)] RESP)
|
||||
</p>
|
||||
<span>
|
||||
|
||||
@@ -164,26 +163,6 @@ the interface <code>to-redis</code>, the signature of which is <code>(Fn [a] RES
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="binder">
|
||||
<a class="anchor" href="#delete">
|
||||
<h3 id="delete">
|
||||
delete
|
||||
</h3>
|
||||
</a>
|
||||
<div class="description">
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [RESP] ())
|
||||
</p>
|
||||
<span>
|
||||
|
||||
</span>
|
||||
<p class="doc">
|
||||
<p>deletes a <code>RESP</code>. This should usually not be called manually.</p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="binder">
|
||||
<a class="anchor" href="#from-string">
|
||||
<h3 id="from-string">
|
||||
@@ -265,6 +244,5 @@ the interface <code>to-redis</code>, the signature of which is <code>(Fn [a] RES
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+8
-1543
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<a href="https://git.veitheller.de/carpentry/redis">
|
||||
<a href="https://veitheller/git/carpentry/redis">
|
||||
<div class="logo">
|
||||
<img src="" alt="Logo">
|
||||
<div class="index">
|
||||
@@ -30,8 +30,9 @@
|
||||
<h1>
|
||||
redis
|
||||
</h1>
|
||||
<p>is a Redis client library for Carp.</p>
|
||||
<pre><code>(load "https://git.veitheller.de/carpentry/redis.git@master")
|
||||
<p>is a collection of modules for talking
|
||||
to Redis.</p>
|
||||
<pre><code>(load "https://veitheller/git/carpentry/redis@master")
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
+9
-59
@@ -4,69 +4,19 @@
|
||||
(match (Redis.open "127.0.0.1")
|
||||
(Result.Success r)
|
||||
(do
|
||||
; basic connectivity
|
||||
(println* &(Redis.ping &r))
|
||||
(println* &(Redis.echo &r @"hello from carp!"))
|
||||
(Redis.send &r "PING" [])
|
||||
(println* &(Redis.read &r))
|
||||
|
||||
; strings
|
||||
(println* &(Redis.set &r @"language" @"carp"))
|
||||
(println* &(Redis.get &r @"language"))
|
||||
(Redis.send &r "PING" [(Box (to-redis @"hiiiii"))])
|
||||
(println* &(Redis.read &r))
|
||||
|
||||
; lists — array responses are proper nested RESP values
|
||||
(println* &(Redis.rpush &r @"queue" @"task-a"))
|
||||
(println* &(Redis.rpush &r @"queue" @"task-b"))
|
||||
(println* &(Redis.rpush &r @"queue" @"task-c"))
|
||||
(println* &(Redis.lrange &r @"queue" @"0" @"-1"))
|
||||
(println* &(Redis.lpop &r @"queue"))
|
||||
(println* &(Redis.llen &r @"queue"))
|
||||
(println* &(Redis.echo &r @"hi"))
|
||||
|
||||
; hashes
|
||||
(println* &(Redis.hset &r @"user:1" @"name" @"alice"))
|
||||
(println* &(Redis.hset &r @"user:1" @"role" @"admin"))
|
||||
(println* &(Redis.hgetall &r @"user:1"))
|
||||
(println* &(Redis.rpush &r @"mylist" @"1"))
|
||||
(println* &(Redis.rpush &r @"mylist" @"2"))
|
||||
(println* &(Redis.lrange &r @"mylist" @"-100" @"100"))
|
||||
|
||||
; sets
|
||||
(println* &(Redis.sadd &r @"tags" @"functional"))
|
||||
(println* &(Redis.sadd &r @"tags" @"systems"))
|
||||
(println* &(Redis.sadd &r @"tags" @"compiled"))
|
||||
(println* &(Redis.smembers &r @"tags"))
|
||||
|
||||
; counters
|
||||
(println* &(Redis.set &r @"hits" @"0"))
|
||||
(println* &(Redis.incr &r @"hits"))
|
||||
(println* &(Redis.incrby &r @"hits" @"99"))
|
||||
(println* &(Redis.get &r @"hits"))
|
||||
|
||||
; key expiry
|
||||
(println* &(Redis.set &r @"session" @"abc123"))
|
||||
(println* &(Redis.expire &r @"session" @"300"))
|
||||
(println* &(Redis.ttl &r @"session"))
|
||||
|
||||
; pattern matching on RESP values
|
||||
(match (Redis.lrange &r @"queue" @"0" @"-1")
|
||||
(Result.Success resp)
|
||||
(match resp
|
||||
(RESP.Arr items)
|
||||
(println* "remaining tasks: " &(Int.str (Array.length &items)))
|
||||
_ (println* "unexpected response"))
|
||||
(Result.Error e) (println* "error: " &e))
|
||||
|
||||
; streams — xrange returns nested arrays (array of [id, [field, value, ...]])
|
||||
(println* &(Redis.xadd &r @"events" @"*" @"type" @"click"))
|
||||
(println* &(Redis.xadd &r @"events" @"*" @"type" @"scroll"))
|
||||
(println* &(Redis.xrange &r @"events" @"-" @"+"))
|
||||
|
||||
; missing key returns Null
|
||||
(println* &(Redis.get &r @"nonexistent"))
|
||||
|
||||
; cleanup
|
||||
(println* &(Redis.del &r @"language"))
|
||||
(println* &(Redis.del &r @"queue"))
|
||||
(println* &(Redis.del &r @"user:1"))
|
||||
(println* &(Redis.del &r @"tags"))
|
||||
(println* &(Redis.del &r @"hits"))
|
||||
(println* &(Redis.del &r @"session"))
|
||||
(println* &(Redis.del &r @"events"))
|
||||
(println* &(Redis.latency-help &r))
|
||||
|
||||
(Redis.close r))
|
||||
(Result.Error err) (IO.errorln &err)))
|
||||
|
||||
+4
-3
@@ -3,12 +3,13 @@
|
||||
(Project.config "title" "redis")
|
||||
(Project.config "docs-directory" "./docs/")
|
||||
(Project.config "docs-logo" "")
|
||||
(Project.config "docs-url" "https://git.veitheller.de/carpentry/redis")
|
||||
(Project.config "docs-url" "https://veitheller/git/carpentry/redis")
|
||||
(Project.config "docs-styling" "../style.css")
|
||||
(Project.config "docs-prelude" "is a Redis client library for Carp.
|
||||
(Project.config "docs-prelude" "is a collection of modules for talking
|
||||
to Redis.
|
||||
|
||||
```
|
||||
(load \"https://git.veitheller.de/carpentry/redis.git@master\")
|
||||
(load \"https://veitheller/git/carpentry/redis@master\")
|
||||
```
|
||||
")
|
||||
|
||||
|
||||
+80
-171
@@ -11,10 +11,6 @@
|
||||
(defmodule RESP
|
||||
(use-all Array Maybe Pattern Result)
|
||||
|
||||
(hidden c)
|
||||
(private c)
|
||||
(def c (prn &@&(Arr [(Box.init (Null))])))
|
||||
|
||||
(defn str [r]
|
||||
(match @r
|
||||
(Null) @"$-1\r\n"
|
||||
@@ -22,86 +18,84 @@
|
||||
(Err s) (fmt "-%s\r\n" &s)
|
||||
(Integer i) (fmt ":%d\r\n" i)
|
||||
(Arr a)
|
||||
(let-do [parts [(fmt "*%d\r\n" (Array.length &a))]]
|
||||
(for [i 0 (Array.length &a)]
|
||||
(Array.push-back! &parts (str (Box.peek (Array.unsafe-nth &a i)))))
|
||||
(String.concat &parts))))
|
||||
(fmt "*%d\r\n%s"
|
||||
(Array.length &a)
|
||||
&(String.concat &(Array.copy-map &(fn [b] (str (unbox b))) &a)))))
|
||||
|
||||
(hidden decode-one)
|
||||
(private decode-one)
|
||||
(defn decode-one [s pos]
|
||||
(if (>= pos (String.length s))
|
||||
(Success (Pair.init (Null) pos))
|
||||
(case (String.char-at s pos)
|
||||
\+ (let [rest-start (+ pos 1)
|
||||
idx (String.index-of-from s \return rest-start)]
|
||||
(if (= idx -1)
|
||||
(Error @"Malformed simple string")
|
||||
(Success (Pair.init
|
||||
(Str (String.slice s rest-start idx))
|
||||
(+ idx 2)))))
|
||||
\- (let [rest-start (+ pos 1)
|
||||
idx (String.index-of-from s \return rest-start)]
|
||||
(if (= idx -1)
|
||||
(Error @"Malformed error string")
|
||||
(Success (Pair.init
|
||||
(Err (String.slice s rest-start idx))
|
||||
(+ idx 2)))))
|
||||
\: (let [rest-start (+ pos 1)
|
||||
idx (String.index-of-from s \return rest-start)]
|
||||
(if (= idx -1)
|
||||
(Error @"Malformed integer")
|
||||
(match (Int.from-string &(String.slice s rest-start idx))
|
||||
(Maybe.Nothing) (Error @"Could not parse integer in result.")
|
||||
(Maybe.Just n) (Success (Pair.init
|
||||
(Integer n)
|
||||
(+ idx 2))))))
|
||||
\$ (let [rest-start (+ pos 1)
|
||||
idx (String.index-of-from s \return rest-start)]
|
||||
(if (= idx -1)
|
||||
(Error @"Malformed bulk string")
|
||||
(match (Int.from-string &(String.slice s rest-start idx))
|
||||
(Maybe.Nothing) (Error @"Error decoding bulk string: does not start with length!")
|
||||
(Maybe.Just len)
|
||||
(if (= len -1)
|
||||
(Success (Pair.init (Null) (+ idx 2)))
|
||||
(let [data-start (+ idx 2)]
|
||||
(Success (Pair.init
|
||||
(Str (String.slice s data-start (+ data-start len)))
|
||||
(+ data-start (+ len 2)))))))))
|
||||
\* (let [rest-start (+ pos 1)
|
||||
idx (String.index-of-from s \return rest-start)]
|
||||
(if (= idx -1)
|
||||
(Error @"Malformed array")
|
||||
(match (Int.from-string &(String.slice s rest-start idx))
|
||||
(Maybe.Nothing) (Error @"Error decoding array: does not start with length!")
|
||||
(Maybe.Just len)
|
||||
(if (= len -1)
|
||||
(Success (Pair.init (Null) (+ idx 2)))
|
||||
(if (= len 0)
|
||||
(Success (Pair.init (Arr []) (+ idx 2)))
|
||||
(let-do [cur (+ idx 2)
|
||||
a (Array.allocate len)
|
||||
(hidden decode-bulk-string)
|
||||
(private decode-bulk-string)
|
||||
(defn decode-bulk-string [s]
|
||||
(if (starts-with? s "-1\r\n")
|
||||
(Success (Pair 4 (Null)))
|
||||
(let [splt (split #"\r\n" s)
|
||||
l (unsafe-first &splt)]
|
||||
(match (from-string l)
|
||||
(Nothing) (Error @"Error decoding bulk string: does not start with length!")
|
||||
(Just il)
|
||||
(Success
|
||||
(Pair (+ il 3)
|
||||
(Str
|
||||
(String.prefix &(join "\r\n" &(suffix &splt 1)) il))))))))
|
||||
|
||||
(private from-string-)
|
||||
(hidden from-string-)
|
||||
(sig from-string- (Fn [&String] (Result (Pair Int RESP) String)))
|
||||
(defn from-string- [s] (Error @"dummy"))
|
||||
|
||||
(hidden decode-arr)
|
||||
(private decode-arr)
|
||||
(defn decode-arr [is]
|
||||
(if (starts-with? &is "0\r\n")
|
||||
(Success (Pair 4 (Arr [])))
|
||||
(let [splt (split #"\r\n" &(chomp &is))
|
||||
sl (unsafe-first &splt)
|
||||
s (join "\r\n" &(suffix &splt 1))]
|
||||
(match (from-string sl)
|
||||
(Nothing)
|
||||
(Error @"Error decoding array: does not start with length!")
|
||||
(Just l)
|
||||
(let-do [a (Array.allocate l)
|
||||
consumed 0
|
||||
err @""]
|
||||
(for [i 0 len]
|
||||
(match (decode-one s cur)
|
||||
(Result.Error e) (do (set! err e) (break))
|
||||
(Result.Success p)
|
||||
(for [i 0 (- l 1)]
|
||||
(match (from-string- &s)
|
||||
(Error msg)
|
||||
(do
|
||||
(aset-uninitialized! &a i (Box.init @(Pair.a &p)))
|
||||
(set! cur @(Pair.b &p)))))
|
||||
(set! err msg)
|
||||
(break))
|
||||
(Success p)
|
||||
(do
|
||||
(+= consumed @(Pair.a &p))
|
||||
(aset-uninitialized! &a i (Box @(Pair.b &p)))
|
||||
(set! s (String.suffix &s @(Pair.a &p))))))
|
||||
(if (= &err "")
|
||||
(Success (Pair.init (Arr a) cur))
|
||||
(Error err))))))))
|
||||
(Error (fmt "Malformed RESP data: got %s" &(String.slice s pos (+ pos 1)))))))
|
||||
(Success (Pair consumed (Arr a)))
|
||||
(Error err)))))))
|
||||
|
||||
(defn from-string- [s]
|
||||
(if (empty? s)
|
||||
(Success (Pair 0 (Null)))
|
||||
(case (head s)
|
||||
\+
|
||||
(let [f (unsafe-first &(split #"\r\n" &(tail s)))]
|
||||
(Success (Pair (String.length f) (Str @f))))
|
||||
\-
|
||||
(let [f (unsafe-first &(split #"\r\n" &(tail s)))]
|
||||
(Success (Pair (String.length f) (Err @f))))
|
||||
\:
|
||||
(let [f (unsafe-first &(split #"\r\n" &(tail s)))]
|
||||
(match (from-string f)
|
||||
(Maybe.Nothing)
|
||||
(Error @"Could not parse integer in result.")
|
||||
(Maybe.Just i)
|
||||
(Success (Pair (String.length f) (Integer i)))))
|
||||
\$ (decode-bulk-string &(tail s))
|
||||
\* (decode-arr (tail s))
|
||||
(Error (fmt "Malformed RESP data: got %s" s)))))
|
||||
|
||||
(doc from-string "converts a RESP string into a `RESP` data structure.")
|
||||
(defn from-string [s]
|
||||
(if (empty? s)
|
||||
(Success (Null))
|
||||
(match (decode-one s 0)
|
||||
(Result.Error e) (Error e)
|
||||
(Result.Success p) (Success @(Pair.a &p)))))
|
||||
(Result.map (from-string- s) &(fn [p] @(Pair.b &p))))
|
||||
|
||||
(definterface to-redis (Fn [a] RESP))
|
||||
)
|
||||
@@ -139,8 +133,9 @@ For variable port numbers please check out [`open-on`](#open-on).")
|
||||
(defn read [r] (RESP.from-string &(Socket.read (sock r))))
|
||||
(doc send "sends the command `cmd` with the arguments `args` to Redis.")
|
||||
(defn send [r cmd args]
|
||||
(let [cmd-parts (copy-map &(fn [x] (Box.init (to-redis @x))) &(Pattern.split #" " &cmd))]
|
||||
(Socket.send (sock r) &(str &(RESP.Arr (concat &[cmd-parts (copy-map &(fn [x] (Box.init @x)) args)]))))))
|
||||
(if (empty? &args)
|
||||
(Socket.send (sock r) &(fmt "%s\r\n" cmd))
|
||||
(Socket.send (sock r) &(str &(RESP.Arr (concat &[[(Box (to-redis @cmd))] args]))))))
|
||||
|
||||
(doc close "closes the connection to Redis.")
|
||||
(defn close [r] (Socket.close @(sock &r)))
|
||||
@@ -155,7 +150,7 @@ For variable port numbers please check out [`open-on`](#open-on).")
|
||||
(defndynamic rconv- [args]
|
||||
(if (= (length args) 0)
|
||||
(array)
|
||||
(cons (list 'to-redis (car args)) (rconv- (cdr args)))))
|
||||
(cons (list 'Box (list 'to-redis (car args))) (rconv- (cdr args)))))
|
||||
|
||||
(defmacro defredis [cmd :rest args]
|
||||
(eval
|
||||
@@ -168,7 +163,7 @@ It takes the same arguments as the [Redis command](https://redis.io/commands/"
|
||||
]))
|
||||
(list 'defn cmd (collect-into (cons 'r args) array)
|
||||
(list 'do
|
||||
(list 'Redis.send 'r (list 'copy (rtreat- (Symbol.str cmd))) (list 'ref (rconv- args)))
|
||||
(list 'Redis.send 'r (rtreat- (Symbol.str cmd)) (rconv- args))
|
||||
'(Redis.read r))))))
|
||||
|
||||
; these commands were scraped from redis.io on the 9th of Feb 2020
|
||||
@@ -414,102 +409,16 @@ It takes the same arguments as the [Redis command](https://redis.io/commands/"
|
||||
(defredis latency-latest)
|
||||
(defredis latency-reset)
|
||||
(defredis latency-help)
|
||||
|
||||
; commands added in Redis 6.0
|
||||
|
||||
(defredis acl-cat)
|
||||
(defredis acl-deluser username)
|
||||
(defredis acl-genpass)
|
||||
(defredis acl-getuser username)
|
||||
(defredis acl-list)
|
||||
(defredis acl-load)
|
||||
(defredis acl-log)
|
||||
(defredis acl-save)
|
||||
(defredis acl-setuser username rule)
|
||||
(defredis acl-users)
|
||||
(defredis acl-whoami)
|
||||
(defredis client-caching mode)
|
||||
(defredis client-getredir)
|
||||
(defredis client-tracking mode)
|
||||
(defredis client-trackinginfo)
|
||||
(defredis hello)
|
||||
(defredis reset)
|
||||
(defredis lpos key element)
|
||||
|
||||
; commands added in Redis 6.2
|
||||
|
||||
(defredis copy source destination)
|
||||
(defredis getdel key)
|
||||
(defredis getex key)
|
||||
(defredis lmove source destination wherefrom whereto)
|
||||
(defredis blmove source destination wherefrom whereto timeout)
|
||||
(defredis smismember key member)
|
||||
(defredis zmscore key member)
|
||||
(defredis zdiff numkeys key)
|
||||
(defredis zdiffstore destination numkeys key)
|
||||
(defredis zunion numkeys key)
|
||||
(defredis zinter numkeys key)
|
||||
(defredis zrangestore dst src min max)
|
||||
(defredis zrandmember key)
|
||||
(defredis hrandfield key)
|
||||
(defredis geosearch key)
|
||||
(defredis geosearchstore destination source)
|
||||
(defredis xautoclaim key group consumer min-idle-time start)
|
||||
(defredis xgroup-createconsumer key groupname consumername)
|
||||
(defredis xgroup-delconsumer key groupname consumername)
|
||||
|
||||
; commands added in Redis 7.0
|
||||
|
||||
(defredis function-load library-code)
|
||||
(defredis function-delete library-name)
|
||||
(defredis function-dump)
|
||||
(defredis function-restore serialized-value)
|
||||
(defredis function-list)
|
||||
(defredis function-stats)
|
||||
(defredis function-flush)
|
||||
(defredis fcall function numkeys)
|
||||
(defredis fcall_ro function numkeys)
|
||||
(defredis eval_ro script numkeys key)
|
||||
(defredis evalsha_ro sha1 numkeys key)
|
||||
(defredis sort_ro key)
|
||||
(defredis lmpop numkeys key)
|
||||
(defredis blmpop timeout numkeys key)
|
||||
(defredis zmpop numkeys key)
|
||||
(defredis bzmpop timeout numkeys key)
|
||||
(defredis zintercard numkeys key)
|
||||
(defredis sintercard numkeys key)
|
||||
(defredis expiretime key)
|
||||
(defredis pexpiretime key)
|
||||
(defredis lcs key1 key2)
|
||||
(defredis cluster-shards)
|
||||
(defredis cluster-links)
|
||||
(defredis cluster-addslotsrange slot)
|
||||
(defredis cluster-delslotsrange slot)
|
||||
(defredis client-no-evict mode)
|
||||
(defredis ssubscribe channel)
|
||||
(defredis sunsubscribe)
|
||||
(defredis spublish channel message)
|
||||
(defredis command-docs command-name)
|
||||
(defredis command-list)
|
||||
(defredis latency-histogram)
|
||||
(defredis module-loadex path)
|
||||
|
||||
; commands added in Redis 7.2
|
||||
|
||||
(defredis client-setinfo attr value)
|
||||
(defredis client-no-touch mode)
|
||||
(defredis waitaof numlocal numreplicas timeout)
|
||||
|
||||
(doc Redis "is a wrapper around Redis connections. It supports opening a
|
||||
connection using [`open`](#open) or [`open-on`](#open-on), reading from and
|
||||
sending to the connection (using [`read`](#read) and [`send`](#send),
|
||||
respectively), and contains thin wrappers around all Redis commands (everything
|
||||
else).")
|
||||
(doc RESP "is a wrapper around the [Redis Serialization
|
||||
Protocol](https://redis.io/topics/protocol). You can create all types,
|
||||
stringify the built types into strings using [`str`](#str), and decode from
|
||||
the string protocol using [`from-string`](#from-string). Arrays are fully
|
||||
supported, including nested arrays.
|
||||
Protocol](https://redis.io/topics/protocol). You can create all types—though
|
||||
creating arrays is a little unsightly due to the absence of recursive types—,
|
||||
stringify the built types into strings using [`str`](#str), and decoding from
|
||||
the string protocol using [`from-string`](#from-string).
|
||||
|
||||
If you want your types to be supported when encoding, you’ll have to implement
|
||||
the interface `to-redis`, the signature of which is `(Fn [a] RESP))`.")
|
||||
|
||||
Reference in New Issue
Block a user