Files
2026-04-11 11:20:25 +02:00

61 lines
2.1 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../style.css">
</head>
<body>
<div class="content">
<a href="https://git.veitheller.de/carpentry/redis">
<div class="logo">
<img src="" alt="Logo">
<div class="index">
<ul>
<li>
<a href="RESP.html">
RESP
</a>
</li>
<li>
<a href="Redis.html">
Redis
</a>
</li>
</ul>
</div>
</div>
<div>
<h1>
redis
</h1>
<p>is a Redis client library for Carp, supporting Redis 7.x.</p>
<h2>Installation</h2>
<pre><code>(load &quot;https://git.veitheller.de/carpentry/redis.git@0.2.0&quot;)
</code></pre>
<h2>Example</h2>
<pre><code>(defn main []
(match (Redis.open &quot;127.0.0.1&quot;)
(Result.Success r)
(do
(println* &amp;(Redis.set &amp;r @&quot;key&quot; @&quot;value&quot;))
(println* &amp;(Redis.get &amp;r @&quot;key&quot;))
(println* &amp;(Redis.lrange &amp;r @&quot;mylist&quot; @&quot;0&quot; @&quot;-1&quot;))
(match (Redis.get &amp;r @&quot;key&quot;)
(Result.Success resp)
(match resp
(RESP.Str s) (println* &quot;got: &quot; &amp;s)
(RESP.Null) (println* &quot;not found&quot;)
_ (println* &quot;unexpected type&quot;))
(Result.Error e) (println* &quot;error: &quot; &amp;e))
(Redis.close r))
(Result.Error err) (IO.errorln &amp;err)))
</code></pre>
</div>
</a>
</div>
</body>
</html>