Current section
Files
Jump to
Current section
Files
doc/cloudi_request_info.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module cloudi_request_info</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>
<h1>Module cloudi_request_info</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="CloudI_RequestInfo_Creation_and_Parsing">CloudI RequestInfo Creation and Parsing</a></h3><p>
RequestInfo is used for request meta-data which is normally
key/value pairs that describe the context of the service request
(e.g., HTTP header names and values for a HTTP request). The default
encoding provided below is a basic format for textual key/value data
(i.e., neither the key or value should contain a null character, '\0')
which is easily parsed in any programming language and is referred to as
the 'text_pairs' format. It is valid to have multiple entries for the
same key within the RequestInfo data. A key must be of size 1 or greater
(<code><<>></code> will never exist as a key in text_pairs data).</p>.
<p>Copyright © 2014-2018 Michael Truog</p>
<p><b>Version:</b> 1.7.4 Nov 28 2019 13:12:55
------------------------------------------------------------------------</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog at protonmail dot com"><tt>mjtruog at protonmail dot com</tt></a>).</p>
<h2><a name="description">Description</a></h2>
<h3><a name="CloudI_RequestInfo_Creation_and_Parsing">CloudI RequestInfo Creation and Parsing</a></h3><p>
RequestInfo is used for request meta-data which is normally
key/value pairs that describe the context of the service request
(e.g., HTTP header names and values for a HTTP request). The default
encoding provided below is a basic format for textual key/value data
(i.e., neither the key or value should contain a null character, '\0')
which is easily parsed in any programming language and is referred to as
the 'text_pairs' format. It is valid to have multiple entries for the
same key within the RequestInfo data. A key must be of size 1 or greater
(<code><<>></code> will never exist as a key in text_pairs data).</p>
<p>Use the 'binary_pairs' format if any of the key/value data is binary
data (i.e., if any of the key or value data contains
null characters, '\0').</p>
<p>The ResponseInfo data is normally service request response meta-data
(providing the response equivalent of RequestInfo for a request)
and can utilize the same functions below.</p>
These module functions provide Erlang serialization of the 'text_pairs'
format and the 'binary_pairs' format for use with the
cloudi_key_value module.
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-format">format()</a></h3>
<p><tt>format() = text_pairs | binary_pairs</tt></p>
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#key_value_append-2">key_value_append/2</a></td><td>
<h4><a name="Append_RequestInfo_key/value_data.">Append RequestInfo key/value data.</a></h4>
Use the same binary format.</td></tr>
<tr><td valign="top"><a href="#key_value_new-1">key_value_new/1</a></td><td>
<h4><a name="New_RequestInfo_key/value_data.">New RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data.</td></tr>
<tr><td valign="top"><a href="#key_value_new-2">key_value_new/2</a></td><td>
<h4><a name="New_RequestInfo_key/value_data.">New RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data.</td></tr>
<tr><td valign="top"><a href="#key_value_parse-1">key_value_parse/1</a></td><td>
<h4><a name="Parse_RequestInfo_key/value_data.">Parse RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="key_value_append-2">key_value_append/2</a></h3>
<div class="spec">
<p><tt>key_value_append(RequestInfo::<a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values()</a>, Existing::binary()) -> Result::binary()</tt><br></p>
</div><p>
<h4><a name="Append_RequestInfo_key/value_data.">Append RequestInfo key/value data.</a></h4>
Use the same binary format.</p>
<h3 class="function"><a name="key_value_new-1">key_value_new/1</a></h3>
<div class="spec">
<p><tt>key_value_new(RequestInfo::<a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values()</a>) -> Result::binary()</tt><br></p>
</div><p>
<h4><a name="New_RequestInfo_key/value_data.">New RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data. Create the binary RequestInfo data with any supported
data structure.</p>
<h3 class="function"><a name="key_value_new-2">key_value_new/2</a></h3>
<div class="spec">
<p><tt>key_value_new(RequestInfo::<a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values()</a>, Format::<a href="#type-format">format()</a>) -> Result::binary()</tt><br></p>
</div><p>
<h4><a name="New_RequestInfo_key/value_data.">New RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data. Create the binary RequestInfo data with any supported
data structure.</p>
<h3 class="function"><a name="key_value_parse-1">key_value_parse/1</a></h3>
<div class="spec">
<p><tt>key_value_parse(RequestInfo::binary() | <a href="cloudi_key_value.html#type-key_values">cloudi_key_value:key_values()</a>) -> Result::#{<a href="cloudi_key_value.html#type-key">cloudi_key_value:key()</a> := <a href="cloudi_key_value.html#type-value">cloudi_key_value:value()</a>}</tt><br></p>
</div><p>
<h4><a name="Parse_RequestInfo_key/value_data.">Parse RequestInfo key/value data.</a></h4>
RequestInfo is meant to contain key/value pairs that is request
meta-data.</p>
<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc</i></p>
</body>
</html>