mirror of
https://github.com/boostorg/redis.git
synced 2026-01-19 04:42:09 +00:00
Improvements in the documentation.
This commit is contained in:
26
Makefile.am
26
Makefile.am
@@ -13,34 +13,8 @@ MY_CPPFLAGS += $(BOOST_CPPFLAGS)
|
||||
MY_CPPFLAGS += -I$(top_srcdir)/include
|
||||
|
||||
MY_LDADD =
|
||||
MY_LDADD += libaedis.a
|
||||
MY_LDADD += -lpthread
|
||||
|
||||
noinst_LIBRARIES = libaedis.a
|
||||
libaedis_a_SOURCES =
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/aedis.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/buffers.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/net.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/connection.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/pipeline.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/type.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/command.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/version.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/impl/connection.ipp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/impl/src.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/impl/type.ipp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/impl/command.ipp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/write.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/read.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/parser.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/response_adapter_base.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/responses.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/utils.hpp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/impl/read.ipp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/include/aedis/detail/impl/parser.ipp
|
||||
libaedis_a_SOURCES += $(top_srcdir)/src/aedis.cpp
|
||||
libaedis_a_CPPFLAGS = $(MY_CPPFLAGS)
|
||||
|
||||
noinst_PROGRAMS =
|
||||
noinst_PROGRAMS += intro
|
||||
intro_SOURCES = $(top_srcdir)/examples/intro.cpp
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
<ul>
|
||||
$navpath
|
||||
<li class="footer">
|
||||
Aedis 1.0.0 - Reference Guide Generated on xxx (GVA Time) using Doxygen $doxygenversion   
|
||||
Aedis 1.0.0 - Reference Guide generated on $datetime using Doxygen $doxygenversion   
|
||||
<img class="footer" src="rootlogo_s.gif" alt="root"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--END GENERATE_TREEVIEW-->
|
||||
<!--BEGIN !GENERATE_TREEVIEW-->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Aedis - Reference Guide Generated on $datetime (GVA Time) using Doxygen $doxygenversion   
|
||||
<img class="footer" src="rootlogo_s.gif" alt="root"/>
|
||||
Aedis 1.0.0 - Reference Guide generated on $datetime using Doxygen $doxygenversion   
|
||||
</small></address>
|
||||
<!--END !GENERATE_TREEVIEW-->
|
||||
</body>
|
||||
|
||||
@@ -11,40 +11,20 @@
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
|
||||
<!-- BEGIN version select -->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://root.cern/doc/dropdown.css">
|
||||
<!--script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
|
||||
</script-->
|
||||
|
||||
<!-- END version select -->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<div id="titlearea">
|
||||
<table bgcolor="#346295" cellspacing="0" cellpadding="0">
|
||||
<table bgcolor="#346295" cellspacing="0" cellpadding="6">
|
||||
<tbody>
|
||||
<tr>
|
||||
<!--td> <a href="https://root.cern"> <img style="height:90px;vertical-align:bottom" alt="Logo" src="$relpath^$projectlogo"/> </a></td-->
|
||||
<td valign="middle" style="color: #FFFFFF" nowrap="nowrap"><font size="6">$projectname</font>  
|
||||
<!-- BEGIN version select -->
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">$projectnumber</button>
|
||||
<div class="dropdown-content">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="../selectversion.js"></script>
|
||||
<!-- END version select -->
|
||||
<br> $projectbrief </td>
|
||||
<td valign="middle" style="color: #FFFFFF" nowrap="nowrap"><font size="6">$projectname</font>   <br> $projectbrief </td>
|
||||
<td style="width:100%"> $searchbox </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include <aedis/resp3/client_base.hpp>
|
||||
#include "user_session.hpp"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include "utils.ipp"
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <list>
|
||||
#include <deque>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <aedis/aedis.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <charconv>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <aedis/aedis.hpp>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
#include "utils.ipp"
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
#include <aedis/resp3/serializer.hpp>
|
||||
|
||||
/** \mainpage
|
||||
\tableofcontents
|
||||
|
||||
\section documentation Documentation
|
||||
Introduction
|
||||
|
||||
- \subpage overview
|
||||
- \subpage installation
|
||||
- \subpage examples
|
||||
|
||||
Reference
|
||||
|
||||
@@ -23,42 +26,22 @@
|
||||
- \subpage read_write_ops
|
||||
- \subpage functions
|
||||
- \subpage operators
|
||||
|
||||
Other
|
||||
|
||||
- \subpage examples
|
||||
|
||||
\section overview Overview
|
||||
|
||||
Aedis is a library that provides low-level communication with a
|
||||
Redis server over its native protocl RESP3. Some of its featues
|
||||
are
|
||||
|
||||
- First class support to STL containers and C++ built-in types.
|
||||
- Support for pipelining, trasactions and TLS.
|
||||
- Serialization and deserializaiton of your own types.
|
||||
- First class support to async programming through ASIO.
|
||||
|
||||
\section installation Installation
|
||||
|
||||
This library is header only. To install it run
|
||||
|
||||
```cpp
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
or copy the include folder to the location you want. You will
|
||||
also need to include the following header in one of your source
|
||||
files e.g. `aedis.cpp`
|
||||
|
||||
```cpp
|
||||
#include <aedis/impl/src.hpp>
|
||||
```
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Pages
|
||||
|
||||
/** \page overview Overview
|
||||
*
|
||||
* Aedis provides low-level communication with a Redis server over
|
||||
* its native protocl RESP3. Some of its featues are
|
||||
*
|
||||
* - First class support to STL containers and C++ built-in types.
|
||||
* - Support for pipelining, trasactions and TLS.
|
||||
* - Serialization and deserializaiton of your own types.
|
||||
* - First class support to async programming through ASIO.
|
||||
*/
|
||||
|
||||
/** \page examples Examples
|
||||
*
|
||||
\b Basics: Focuses on small code snipets that show basic usage of
|
||||
@@ -139,6 +122,23 @@
|
||||
between the user and the database.
|
||||
*/
|
||||
|
||||
/** \page installation Intallation
|
||||
*
|
||||
* This library is header only. To install it run
|
||||
*
|
||||
* ```cpp
|
||||
* $ sudo make install
|
||||
* ```
|
||||
*
|
||||
* or copy the include folder to the location you want. You will
|
||||
* also need to include the following header in one of your source
|
||||
* files e.g. `aedis.cpp`
|
||||
*
|
||||
* ```cpp
|
||||
* #include <aedis/impl/src.hpp>
|
||||
* ```
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Groups
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace resp3 {
|
||||
* \ingroup classes
|
||||
|
||||
This class is meant to be an example. Users are meant to derive
|
||||
from this class and override
|
||||
from this class and override its virtual functions.
|
||||
|
||||
1. on_event.
|
||||
2. on_push.
|
||||
@@ -34,10 +34,11 @@ protected:
|
||||
std::vector<node> push_resp_;
|
||||
|
||||
private:
|
||||
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
|
||||
|
||||
// Hello response.
|
||||
std::vector<node> hello_;
|
||||
|
||||
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
|
||||
std::queue<serializer<ResponseId>> srs_;
|
||||
tcp_socket socket_;
|
||||
|
||||
@@ -51,7 +52,7 @@ private:
|
||||
{
|
||||
// Writes and reads continuosly from the socket.
|
||||
for (std::string buffer;;) {
|
||||
// Keeps reading while there is no messages queued waiting to be sent.
|
||||
// Keeps reading while there are no messages queued waiting to be sent.
|
||||
do {
|
||||
// Loops to consume the response to all commands in the request.
|
||||
do {
|
||||
@@ -101,6 +102,7 @@ private:
|
||||
co_await net::async_write(socket_, net::buffer(sr.request()));
|
||||
|
||||
std::string buffer;
|
||||
hello_.clear();
|
||||
co_await resp3::async_read(socket_, net::dynamic_buffer(buffer), adapt(hello_));
|
||||
}
|
||||
|
||||
@@ -162,7 +164,8 @@ public:
|
||||
|
||||
/** \brief Starts the client.
|
||||
*
|
||||
* Stablishes a connection with the redis server and keeps waiting for messages to send.
|
||||
* Stablishes a connection with the redis server and keeps
|
||||
* waiting for messages to send.
|
||||
*/
|
||||
void start()
|
||||
{
|
||||
@@ -171,7 +174,7 @@ public:
|
||||
net::detached);
|
||||
}
|
||||
|
||||
/** \brief Adds commands the requests queue and sends if possible.
|
||||
/** \brief Adds commands to the request queue and sends if possible.
|
||||
*
|
||||
* The filler callable get a request by reference, for example
|
||||
*
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2019 - 2021 Marcelo Zimbres Silva (mzimbres at gmail dot com)
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
17
tests/check.hpp
Normal file
17
tests/check.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Copyright (c) 2019 Marcelo Zimbres Silva (mzimbres@gmail.com)
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
template <class T>
|
||||
void check_equal(T const& a, T const& b, std::string const& msg = "")
|
||||
{
|
||||
if (a == b)
|
||||
std::cout << "Success: " << msg << std::endl;
|
||||
else
|
||||
std::cout << "Error: " << msg << std::endl;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2019 - 2021 Marcelo Zimbres Silva (mzimbres at gmail dot com)
|
||||
/* Copyright (c) 2019 Marcelo Zimbres Silva (mzimbres@gmail.com)
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -8,13 +8,13 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include "test_stream.hpp"
|
||||
#include "check.hpp"
|
||||
|
||||
// TODO: Use Beast test_stream and instantiate the test socket only
|
||||
// once.
|
||||
// Consider using Beast test_stream and instantiate the test socket
|
||||
// only once.
|
||||
|
||||
namespace net = aedis::net;
|
||||
using tcp = net::ip::tcp;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
#include "test_stream.hpp"
|
||||
#include "check.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2019 - 2021 Marcelo Zimbres Silva (mzimbres at gmail dot com)
|
||||
/* Copyright (c) 2019 Marcelo Zimbres Silva (mzimbres.gmail.com)
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
#include <aedis/src.hpp>
|
||||
#include <aedis/aedis.hpp>
|
||||
|
||||
namespace resp3 = aedis::resp3;
|
||||
|
||||
Reference in New Issue
Block a user