mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
update docs
This commit is contained in:
parent
76757038f4
commit
8f80d24534
6 changed files with 15 additions and 11 deletions
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Buf_ (tiny_httpd.Tiny_httpd.Buf_)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Buf_</nav><h1>Module <code>Tiny_httpd.Buf_</code></h1><h3 id="tiny-buffer-implementation"><a href="#tiny-buffer-implementation" class="anchor"></a>Tiny buffer implementation</h3><p>These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.</p></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></dl><dl><dt class="spec value" id="val-size"><a href="#val-size" class="anchor"></a><code><span class="keyword">val</span> size : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dt class="spec value" id="val-clear"><a href="#val-clear" class="anchor"></a><code><span class="keyword">val</span> clear : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : <span>?⁠size:int</span> <span>-></span> unit <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-contents"><a href="#val-contents" class="anchor"></a><code><span class="keyword">val</span> contents : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt></dl></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Buf_ (tiny_httpd.Tiny_httpd.Buf_)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Buf_</nav><h1>Module <code>Tiny_httpd.Buf_</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></dl><dl><dt class="spec value" id="val-size"><a href="#val-size" class="anchor"></a><code><span class="keyword">val</span> size : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dt class="spec value" id="val-clear"><a href="#val-clear" class="anchor"></a><code><span class="keyword">val</span> clear : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : <span>?⁠size:int</span> <span>-></span> unit <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-contents"><a href="#val-contents" class="anchor"></a><code><span class="keyword">val</span> contents : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Response_code (tiny_httpd.Tiny_httpd.Response_code)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Response_code</nav><h1>Module <code>Tiny_httpd.Response_code</code></h1><h3 id="response-code"><a href="#response-code" class="anchor"></a>Response code</h3></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = int</code></dt><dd><p>A standard HTTP code.</p><p>https://tools.ietf.org/html/rfc7231#section-6</p></dd></dl><dl><dt class="spec value" id="val-ok"><a href="#val-ok" class="anchor"></a><code><span class="keyword">val</span> ok : <a href="index.html#type-t">t</a></code></dt><dd><p>The code <code>200</code></p></dd></dl><dl><dt class="spec value" id="val-not_found"><a href="#val-not_found" class="anchor"></a><code><span class="keyword">val</span> not_found : <a href="index.html#type-t">t</a></code></dt><dd><p>The code <code>404</code></p></dd></dl><dl><dt class="spec value" id="val-descr"><a href="#val-descr" class="anchor"></a><code><span class="keyword">val</span> descr : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>A description of some of the error codes. NOTE: this is not complete (yet).</p></dd></dl></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Response_code (tiny_httpd.Tiny_httpd.Response_code)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Response_code</nav><h1>Module <code>Tiny_httpd.Response_code</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = int</code></dt><dd><p>A standard HTTP code.</p><p>https://tools.ietf.org/html/rfc7231#section-6</p></dd></dl><dl><dt class="spec value" id="val-ok"><a href="#val-ok" class="anchor"></a><code><span class="keyword">val</span> ok : <a href="index.html#type-t">t</a></code></dt><dd><p>The code <code>200</code></p></dd></dl><dl><dt class="spec value" id="val-not_found"><a href="#val-not_found" class="anchor"></a><code><span class="keyword">val</span> not_found : <a href="index.html#type-t">t</a></code></dt><dd><p>The code <code>404</code></p></dd></dl><dl><dt class="spec value" id="val-descr"><a href="#val-descr" class="anchor"></a><code><span class="keyword">val</span> descr : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>A description of some of the error codes. NOTE: this is not complete (yet).</p></dd></dl></div></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Stream_ (tiny_httpd.Tiny_httpd.Stream_)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Stream_</nav><h1>Module <code>Tiny_httpd.Stream_</code></h1><h3 id="generic-stream-of-data"><a href="#generic-stream-of-data" class="anchor"></a>Generic stream of data</h3><p>Streams are used to represent a series of bytes that can arrive progressively. For example, an uploaded file will be sent as a series of chunks.</p></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../index.html#type-stream">stream</a></code></dt></dl><dl><dt class="spec value" id="val-close"><a href="#val-close" class="anchor"></a><code><span class="keyword">val</span> close : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-of_chan"><a href="#val-of_chan" class="anchor"></a><code><span class="keyword">val</span> of_chan : Pervasives.in_channel <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Make a buffered stream from the given channel.</p></dd></dl><dl><dt class="spec value" id="val-of_chan_close_noerr"><a href="#val-of_chan_close_noerr" class="anchor"></a><code><span class="keyword">val</span> of_chan_close_noerr : Pervasives.in_channel <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Same as <a href="index.html#val-of_chan"><code>of_chan</code></a> but the <code>close</code> method will never fail.</p></dd></dl><dl><dt class="spec value" id="val-of_bytes"><a href="#val-of_bytes" class="anchor"></a><code><span class="keyword">val</span> of_bytes : <span>?⁠i:int</span> <span>-></span> <span>?⁠len:int</span> <span>-></span> bytes <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>A stream that just returns the slice of bytes starting from <code>i</code> and of length <code>len</code>.</p></dd></dl><dl><dt class="spec value" id="val-with_file"><a href="#val-with_file" class="anchor"></a><code><span class="keyword">val</span> with_file : string <span>-></span> <span>(<a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span>)</span> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p>Open a file with given name, and obtain an input stream on its content. When the function returns, the stream (and file) are closed.</p></dd></dl><dl><dt class="spec value" id="val-read_line"><a href="#val-read_line" class="anchor"></a><code><span class="keyword">val</span> read_line : <span>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Read a line from the stream.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-read_all"><a href="#val-read_all" class="anchor"></a><code><span class="keyword">val</span> read_all : <span>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Read the whole stream into a string.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Stream_ (tiny_httpd.Tiny_httpd.Stream_)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd</a> » Stream_</nav><h1>Module <code>Tiny_httpd.Stream_</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../index.html#type-stream">stream</a></code></dt></dl><dl><dt class="spec value" id="val-close"><a href="#val-close" class="anchor"></a><code><span class="keyword">val</span> close : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-of_chan"><a href="#val-of_chan" class="anchor"></a><code><span class="keyword">val</span> of_chan : Pervasives.in_channel <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Make a buffered stream from the given channel.</p></dd></dl><dl><dt class="spec value" id="val-of_chan_close_noerr"><a href="#val-of_chan_close_noerr" class="anchor"></a><code><span class="keyword">val</span> of_chan_close_noerr : Pervasives.in_channel <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Same as <a href="index.html#val-of_chan"><code>of_chan</code></a> but the <code>close</code> method will never fail.</p></dd></dl><dl><dt class="spec value" id="val-of_bytes"><a href="#val-of_bytes" class="anchor"></a><code><span class="keyword">val</span> of_bytes : <span>?⁠i:int</span> <span>-></span> <span>?⁠len:int</span> <span>-></span> bytes <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>A stream that just returns the slice of bytes starting from <code>i</code> and of length <code>len</code>.</p></dd></dl><dl><dt class="spec value" id="val-with_file"><a href="#val-with_file" class="anchor"></a><code><span class="keyword">val</span> with_file : string <span>-></span> <span>(<a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span>)</span> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p>Open a file with given name, and obtain an input stream on its content. When the function returns, the stream (and file) are closed.</p></dd></dl><dl><dt class="spec value" id="val-read_line"><a href="#val-read_line" class="anchor"></a><code><span class="keyword">val</span> read_line : <span>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Read a line from the stream.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-read_all"><a href="#val-read_all" class="anchor"></a><code><span class="keyword">val</span> read_all : <span>?⁠buf:<a href="../Buf_/index.html#type-t">Buf_.t</a></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Read the whole stream into a string.</p><dl><dt>parameter buf</dt><dd><p>a buffer to (re)use. Its content will be cleared.</p></dd></dl></dd></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue