bunkerweb/docs/modules/resty.session.redis.common.html

323 lines
11 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Session Library for OpenResty Documentation</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>resty.session</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/resty.session.html">resty.session</a></li>
<li><a href="../modules/resty.session.dshm.html">resty.session.dshm</a></li>
<li><a href="../modules/resty.session.file.html">resty.session.file</a></li>
<li><a href="../modules/resty.session.file.thread.html">resty.session.file.thread</a></li>
<li><a href="../modules/resty.session.file.utils.html">resty.session.file.utils</a></li>
<li><a href="../modules/resty.session.memcached.html">resty.session.memcached</a></li>
<li><a href="../modules/resty.session.mysql.html">resty.session.mysql</a></li>
<li><a href="../modules/resty.session.postgres.html">resty.session.postgres</a></li>
<li><a href="../modules/resty.session.redis.html">resty.session.redis</a></li>
<li><a href="../modules/resty.session.redis.cluster.html">resty.session.redis.cluster</a></li>
<li><strong>resty.session.redis.common</strong></li>
<li><a href="../modules/resty.session.redis.sentinel.html">resty.session.redis.sentinel</a></li>
<li><a href="../modules/resty.session.shm.html">resty.session.shm</a></li>
<li><a href="../modules/resty.session.utils.html">resty.session.utils</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>resty.session.redis.common</code></h1>
<p>Common Redis functions shared between Redis,
Redis Cluster and Redis Sentinel implementations.</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#module.SET">module.SET (storage, red, name, key, value, ttl, current_time[, old_key], stale_ttl[, metadata], remember)</a></td>
<td class="summary">Store session data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#module.GET">module.GET (storage, red, name, key)</a></td>
<td class="summary">Retrieve session data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#module.UNLINK">module.UNLINK (storage, red, name, key, current_time[, metadata])</a></td>
<td class="summary">Delete session data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#module.READ_METADATA">module.READ_METADATA (storage, red, name, audience, subject, current_time)</a></td>
<td class="summary">Read session metadata.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "module.SET"></a>
<strong>module.SET (storage, red, name, key, value, ttl, current_time[, old_key], stale_ttl[, metadata], remember)</strong>
</dt>
<dd>
Store session data.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">storage</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the storage
</li>
<li><span class="parameter">red</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the redis instance
</li>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the cookie name
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session key
</li>
<li><span class="parameter">value</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session value
</li>
<li><span class="parameter">ttl</span>
<span class="types"><span class="type">number</span></span>
session ttl
</li>
<li><span class="parameter">current_time</span>
<span class="types"><span class="type">number</span></span>
current time
</li>
<li><span class="parameter">old_key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
old session id
(<em>optional</em>)
</li>
<li><span class="parameter">stale_ttl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
stale ttl
</li>
<li><span class="parameter">metadata</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
table of metadata
(<em>optional</em>)
</li>
<li><span class="parameter">remember</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
whether storing persistent session or not
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><span class="type">true</span> or <span class="type">nil</span></span>
ok</li>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
error message</li>
</ol>
</dd>
<dt>
<a name = "module.GET"></a>
<strong>module.GET (storage, red, name, key)</strong>
</dt>
<dd>
Retrieve session data.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">storage</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the storage
</li>
<li><span class="parameter">red</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the redis instance
</li>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
cookie name
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session key
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
session data</li>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
error message</li>
</ol>
</dd>
<dt>
<a name = "module.UNLINK"></a>
<strong>module.UNLINK (storage, red, name, key, current_time[, metadata])</strong>
</dt>
<dd>
Delete session data.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">storage</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the storage
</li>
<li><span class="parameter">red</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the redis instance
</li>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
cookie name
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session key
</li>
<li><span class="parameter">current_time</span>
<span class="types"><span class="type">number</span></span>
current time
</li>
<li><span class="parameter">metadata</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
session meta data
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
session data</li>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
error message</li>
</ol>
</dd>
<dt>
<a name = "module.READ_METADATA"></a>
<strong>module.READ_METADATA (storage, red, name, audience, subject, current_time)</strong>
</dt>
<dd>
Read session metadata.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">storage</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the storage
</li>
<li><span class="parameter">red</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
the redis instance
</li>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
cookie name
</li>
<li><span class="parameter">audience</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session key
</li>
<li><span class="parameter">subject</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
session key
</li>
<li><span class="parameter">current_time</span>
<span class="types"><span class="type">number</span></span>
current time
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">nil</span></span>
session metadata</li>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
error message</li>
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-08-16 18:11:28 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>