This commit is contained in:
c-cube 2022-12-14 02:23:15 +00:00
parent d407337cca
commit 25feee7935
47 changed files with 580 additions and 116 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

1
dev/katex.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
dev/katex.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
@charset "UTF-8";
/* Copyright (c) 2016 The odoc contributors. All rights reserved.
Distributed under the ISC license, see terms at the end of the file.
odoc 2.1.1 */
odoc 2.2.0 */
/* Fonts */
@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500');
@ -419,8 +419,8 @@ pre code {
padding: 0.35em 0.5em;
}
.def-doc {
margin-bottom: 10px;
li:not(:last-child) > .def-doc {
margin-bottom: 15px;
}
/* Spacing between items */
@ -428,19 +428,35 @@ div.odoc-spec,.odoc-include {
margin-bottom: 2em;
}
.spec.type .variant {
.spec.type .variant p, .spec.type .record p {
margin: 5px;
}
.spec.type .variant, .spec.type .record {
margin-left: 2ch;
list-style: none;
display: flex;
flex-wrap: wrap;
row-gap: 4px;
}
.spec.type .variant p {
margin: 0;
font-style: italic;
.spec.type .record > code, .spec.type .variant > code {
min-width: 40%;
}
.spec.type .record {
margin-left: 2ch;
.spec.type > ol {
margin-top: 0;
margin-bottom: 0;
}
.spec.type .record p {
margin: 0;
font-style: italic;
.spec.type .record > .def-doc, .spec.type .variant > .def-doc {
min-width:50%;
padding: 0.25em 0.5em;
margin-left: 10%;
border-radius: 3px;
flex-grow:1;
background: var(--main-background);
box-shadow: 2px 2px 4px lightgrey;
}
div.def {
@ -449,11 +465,6 @@ div.def {
padding-left: 2ex;
}
div.def+div.def-doc {
margin-left: 1ex;
margin-top: 2.5px
}
div.def-doc>*:first-child {
margin-top: 0;
}
@ -666,9 +677,8 @@ td.def-doc *:first-child {
/* Mobile adjustements. */
@media only screen and (max-width: 95ex) {
.odoc-content {
margin: auto;
padding: 2em;
body.odoc {
margin: 2em;
}
.odoc-toc {
position: static;
@ -678,6 +688,7 @@ td.def-doc *:first-child {
border: none;
padding: 0.2em 1em;
border-radius: 5px;
margin-bottom: 2em;
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd</a> &#x00BB; Tiny_httpd_buf</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_buf</span></code></h1><p>Simple buffer.</p><p>These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-size" class="anchored"><a href="#val-size" class="anchor"></a><code><span><span class="keyword">val</span> size : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-clear" class="anchored"><a href="#val-clear" class="anchor"></a><code><span><span class="keyword">val</span> clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-create" class="anchored"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>?size:int <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-contents" class="anchored"><a href="#val-contents" class="anchor"></a><code><span><span class="keyword">val</span> contents : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-bytes_slice" class="anchored"><a href="#val-bytes_slice" class="anchor"></a><code><span><span class="keyword">val</span> bytes_slice : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bytes</span></code></div><div class="spec-doc"><p>Access underlying slice of bytes.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-contents_and_clear" class="anchored"><a href="#val-contents_and_clear" class="anchor"></a><code><span><span class="keyword">val</span> contents_and_clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Get contents of the buffer and clear it.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-add_bytes" class="anchored"><a href="#val-add_bytes" class="anchor"></a><code><span><span class="keyword">val</span> add_bytes : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Append given bytes slice to the buffer.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd</a> &#x00BB; Tiny_httpd_buf</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_buf</span></code></h1><p>Simple buffer.</p><p>These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-size"><a href="#val-size" class="anchor"></a><code><span><span class="keyword">val</span> size : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-clear"><a href="#val-clear" class="anchor"></a><code><span><span class="keyword">val</span> clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>?size:int <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contents"><a href="#val-contents" class="anchor"></a><code><span><span class="keyword">val</span> contents : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bytes_slice"><a href="#val-bytes_slice" class="anchor"></a><code><span><span class="keyword">val</span> bytes_slice : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bytes</span></code></div><div class="spec-doc"><p>Access underlying slice of bytes.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contents_and_clear"><a href="#val-contents_and_clear" class="anchor"></a><code><span><span class="keyword">val</span> contents_and_clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Get contents of the buffer and clear it.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_bytes"><a href="#val-add_bytes" class="anchor"></a><code><span><span class="keyword">val</span> add_bytes : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Append given bytes slice to the buffer.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Embedded_fs (tiny_httpd.Tiny_httpd_dir.Embedded_fs)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_dir</a> &#x00BB; Embedded_fs</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_dir.Embedded_fs</span></code></h1><p>An embedded file system, as a list of files with (relative) paths. This is useful in combination with the &quot;tiny-httpd-mkfs&quot; tool, which embeds the files it's given into a OCaml module.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>The pseudo-filesystem</p></div></div><div class="odoc-spec"><div class="spec value" id="val-create" class="anchored"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>?mtime:float <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_file" class="anchored"><a href="#val-add_file" class="anchor"></a><code><span><span class="keyword">val</span> add_file : <span>?mtime:float <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>path:string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Add file to the virtual file system.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <span class="value">Invalid_argument</span> <p>if the path contains '..' or if it tries to make a directory out of an existing path that is a file.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-to_vfs" class="anchored"><a href="#val-to_vfs" class="anchor"></a><code><span><span class="keyword">val</span> to_vfs : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>(<span class="keyword">module</span> <a href="../module-type-VFS/index.html">VFS</a>)</span></span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Embedded_fs (tiny_httpd.Tiny_httpd_dir.Embedded_fs)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_dir</a> &#x00BB; Embedded_fs</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_dir.Embedded_fs</span></code></h1><p>An embedded file system, as a list of files with (relative) paths. This is useful in combination with the &quot;tiny-httpd-mkfs&quot; tool, which embeds the files it's given into a OCaml module.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>The pseudo-filesystem</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>?mtime:float <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_file"><a href="#val-add_file" class="anchor"></a><code><span><span class="keyword">val</span> add_file : <span>?mtime:float <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>path:string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Add file to the virtual file system.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <span class="value">Invalid_argument</span> <p>if the path contains '..' or if it tries to make a directory out of an existing path that is a file.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_vfs"><a href="#val-to_vfs" class="anchor"></a><code><span><span class="keyword">val</span> to_vfs : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>(<span class="keyword">module</span> <a href="../module-type-VFS/index.html">VFS</a>)</span></span></code></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>VFS (tiny_httpd.Tiny_httpd_dir.VFS)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_dir</a> &#x00BB; VFS</nav><header class="odoc-preamble"><h1>Module type <code><span>Tiny_httpd_dir.VFS</span></code></h1><p>Virtual file system.</p><p>This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-descr" class="anchored"><a href="#val-descr" class="anchor"></a><code><span><span class="keyword">val</span> descr : string</span></code></div><div class="spec-doc"><p>Description of the VFS</p></div></div><div class="odoc-spec"><div class="spec value" id="val-is_directory" class="anchored"><a href="#val-is_directory" class="anchor"></a><code><span><span class="keyword">val</span> is_directory : <span>string <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-contains" class="anchored"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>file_exists vfs path</code> returns <code>true</code> if <code>path</code> points to a file or directory inside <code>vfs</code>.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-list_dir" class="anchored"><a href="#val-list_dir" class="anchor"></a><code><span><span class="keyword">val</span> list_dir : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string array</span></span></code></div><div class="spec-doc"><p>List directory. This only returns basenames, the files need to be put in the directory path using <code>Filename</code>.concat.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-delete" class="anchored"><a href="#val-delete" class="anchor"></a><code><span><span class="keyword">val</span> delete : <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Delete path</p></div></div><div class="odoc-spec"><div class="spec value" id="val-create" class="anchored"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>string <span class="arrow">&#45;&gt;</span></span> <span>( <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit )</span> * <span>( <span>unit <span class="arrow">&#45;&gt;</span></span> unit )</span></span></code></div><div class="spec-doc"><p>Create a file and obtain a pair <code>write, close</code></p></div></div><div class="odoc-spec"><div class="spec value" id="val-read_file_content" class="anchored"><a href="#val-read_file_content" class="anchor"></a><code><span><span class="keyword">val</span> read_file_content : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="../../Tiny_httpd_stream/index.html#type-t">Tiny_httpd_stream.t</a></span></code></div><div class="spec-doc"><p>Read content of a file</p></div></div><div class="odoc-spec"><div class="spec value" id="val-file_size" class="anchored"><a href="#val-file_size" class="anchor"></a><code><span><span class="keyword">val</span> file_size : <span>string <span class="arrow">&#45;&gt;</span></span> <span>int option</span></span></code></div><div class="spec-doc"><p>File size, e.g. using &quot;stat&quot;</p></div></div><div class="odoc-spec"><div class="spec value" id="val-file_mtime" class="anchored"><a href="#val-file_mtime" class="anchor"></a><code><span><span class="keyword">val</span> file_mtime : <span>string <span class="arrow">&#45;&gt;</span></span> <span>float option</span></span></code></div><div class="spec-doc"><p>File modification time, e.g. using &quot;stat&quot;</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>VFS (tiny_httpd.Tiny_httpd_dir.VFS)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_dir</a> &#x00BB; VFS</nav><header class="odoc-preamble"><h1>Module type <code><span>Tiny_httpd_dir.VFS</span></code></h1><p>Virtual file system.</p><p>This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-descr"><a href="#val-descr" class="anchor"></a><code><span><span class="keyword">val</span> descr : string</span></code></div><div class="spec-doc"><p>Description of the VFS</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_directory"><a href="#val-is_directory" class="anchor"></a><code><span><span class="keyword">val</span> is_directory : <span>string <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contains"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>file_exists vfs path</code> returns <code>true</code> if <code>path</code> points to a file or directory inside <code>vfs</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-list_dir"><a href="#val-list_dir" class="anchor"></a><code><span><span class="keyword">val</span> list_dir : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string array</span></span></code></div><div class="spec-doc"><p>List directory. This only returns basenames, the files need to be put in the directory path using <code>Filename</code>.concat.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-delete"><a href="#val-delete" class="anchor"></a><code><span><span class="keyword">val</span> delete : <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Delete path</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>string <span class="arrow">&#45;&gt;</span></span> <span>(<span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit)</span> * <span>(<span>unit <span class="arrow">&#45;&gt;</span></span> unit)</span></span></code></div><div class="spec-doc"><p>Create a file and obtain a pair <code>write, close</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-read_file_content"><a href="#val-read_file_content" class="anchor"></a><code><span><span class="keyword">val</span> read_file_content : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="../../Tiny_httpd_stream/index.html#type-t">Tiny_httpd_stream.t</a></span></code></div><div class="spec-doc"><p>Read content of a file</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-file_size"><a href="#val-file_size" class="anchor"></a><code><span><span class="keyword">val</span> file_size : <span>string <span class="arrow">&#45;&gt;</span></span> <span>int option</span></span></code></div><div class="spec-doc"><p>File size, e.g. using &quot;stat&quot;</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-file_mtime"><a href="#val-file_mtime" class="anchor"></a><code><span><span class="keyword">val</span> file_mtime : <span>string <span class="arrow">&#45;&gt;</span></span> <span>float option</span></span></code></div><div class="spec-doc"><p>File modification time, e.g. using &quot;stat&quot;</p></div></div></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

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Out (tiny_httpd.Tiny_httpd_html_.Out)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_html_</a> &#x00BB; Out</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_html_.Out</span></code></h1><p>Output for HTML combinators.</p><p>This output type is used to produce a string reasonably efficiently from a tree of combinators.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-create" class="anchored"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-clear" class="anchored"><a href="#val-clear" class="anchor"></a><code><span><span class="keyword">val</span> clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_char" class="anchored"><a href="#val-add_char" class="anchor"></a><code><span><span class="keyword">val</span> add_char : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>char <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_string" class="anchored"><a href="#val-add_string" class="anchor"></a><code><span><span class="keyword">val</span> add_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_format_nl" class="anchored"><a href="#val-add_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> add_format_nl : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-with_no_format_nl" class="anchored"><a href="#val-with_no_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> with_no_format_nl : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>( <span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span> )</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-to_string" class="anchored"><a href="#val-to_string" class="anchor"></a><code><span><span class="keyword">val</span> to_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Out (tiny_httpd.Tiny_httpd_html_.Out)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_html_</a> &#x00BB; Out</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_html_.Out</span></code></h1><p>Output for HTML combinators.</p><p>This output type is used to produce a string reasonably efficiently from a tree of combinators.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-clear"><a href="#val-clear" class="anchor"></a><code><span><span class="keyword">val</span> clear : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_char"><a href="#val-add_char" class="anchor"></a><code><span><span class="keyword">val</span> add_char : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>char <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_string"><a href="#val-add_string" class="anchor"></a><code><span><span class="keyword">val</span> add_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_format_nl"><a href="#val-add_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> add_format_nl : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_no_format_nl"><a href="#val-with_no_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> with_no_format_nl : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span><span class="keyword">val</span> to_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers (tiny_httpd.Tiny_httpd_server.Headers)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Headers</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Headers</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><span>(string * string)</span> list</span></span></code></div><div class="spec-doc"><p>The header files of a request or response.</p><p>Neither the key nor the value can contain <code>'\r'</code> or <code>'\n'</code>. See https://tools.ietf.org/html/rfc7230#section-3.2</p></div></div><div class="odoc-spec"><div class="spec value" id="val-empty" class="anchored"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Empty list of headers</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-get" class="anchored"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>?f:<span>( <span>string <span class="arrow">&#45;&gt;</span></span> string )</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>get k headers</code> looks for the header field with key <code>k</code>.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">f</span> <p>if provided, will transform the value before it is returned.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-set" class="anchored"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>set k v headers</code> sets the key <code>k</code> to value <code>v</code>. It erases any previous entry for <code>k</code></p></div></div><div class="odoc-spec"><div class="spec value" id="val-remove" class="anchored"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Remove the key from the headers, if present.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-contains" class="anchored"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p>Is there a header with the given key?</p></div></div><div class="odoc-spec"><div class="spec value" id="val-pp" class="anchored"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Pretty print the headers.</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers (tiny_httpd.Tiny_httpd_server.Headers)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Headers</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Headers</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><span>(string * string)</span> list</span></span></code></div><div class="spec-doc"><p>The header files of a request or response.</p><p>Neither the key nor the value can contain <code>'\r'</code> or <code>'\n'</code>. See https://tools.ietf.org/html/rfc7230#section-3.2</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Empty list of headers</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>?f:<span>(<span>string <span class="arrow">&#45;&gt;</span></span> string)</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p><code>get k headers</code> looks for the header field with key <code>k</code>.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">f</span> <p>if provided, will transform the value before it is returned.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>set k v headers</code> sets the key <code>k</code> to value <code>v</code>. It erases any previous entry for <code>k</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Remove the key from the headers, if present.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-contains"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p>Is there a header with the given key?</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Pretty print the headers.</p></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Meth (tiny_httpd.Tiny_httpd_server.Meth)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Meth</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Meth</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = </span><span>[ </span></code><table><tr id="type-t.GET" class="anchored"><td class="def constructor"><a href="#type-t.GET" class="anchor"></a><code><span>| </span></code><code><span>`GET</span></code></td></tr><tr id="type-t.PUT" class="anchored"><td class="def constructor"><a href="#type-t.PUT" class="anchor"></a><code><span>| </span></code><code><span>`PUT</span></code></td></tr><tr id="type-t.POST" class="anchored"><td class="def constructor"><a href="#type-t.POST" class="anchor"></a><code><span>| </span></code><code><span>`POST</span></code></td></tr><tr id="type-t.HEAD" class="anchored"><td class="def constructor"><a href="#type-t.HEAD" class="anchor"></a><code><span>| </span></code><code><span>`HEAD</span></code></td></tr><tr id="type-t.DELETE" class="anchored"><td class="def constructor"><a href="#type-t.DELETE" class="anchor"></a><code><span>| </span></code><code><span>`DELETE</span></code></td></tr></table><code><span> ]</span></code></div><div class="spec-doc"><p>A HTTP method. For now we only handle a subset of these.</p><p>See https://tools.ietf.org/html/rfc7231#section-4</p></div></div><div class="odoc-spec"><div class="spec value" id="val-pp" class="anchored"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-to_string" class="anchored"><a href="#val-to_string" class="anchor"></a><code><span><span class="keyword">val</span> to_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Meth (tiny_httpd.Tiny_httpd_server.Meth)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Meth</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Meth</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = </span><span>[ </span></code><ol><li id="type-t.GET" class="def constructor anchored"><a href="#type-t.GET" class="anchor"></a><code><span>| </span></code><code><span>`GET</span></code></li><li id="type-t.PUT" class="def constructor anchored"><a href="#type-t.PUT" class="anchor"></a><code><span>| </span></code><code><span>`PUT</span></code></li><li id="type-t.POST" class="def constructor anchored"><a href="#type-t.POST" class="anchor"></a><code><span>| </span></code><code><span>`POST</span></code></li><li id="type-t.HEAD" class="def constructor anchored"><a href="#type-t.HEAD" class="anchor"></a><code><span>| </span></code><code><span>`HEAD</span></code></li><li id="type-t.DELETE" class="def constructor anchored"><a href="#type-t.DELETE" class="anchor"></a><code><span>| </span></code><code><span>`DELETE</span></code></li></ol><code><span> ]</span></code></div><div class="spec-doc"><p>A HTTP method. For now we only handle a subset of these.</p><p>See https://tools.ietf.org/html/rfc7231#section-4</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span><span class="keyword">val</span> to_string : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Middleware (tiny_httpd.Tiny_httpd_server.Middleware)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Middleware</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Middleware</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#middlewares">Middlewares</a></li></ul></nav><div class="odoc-content"><h3 id="middlewares"><a href="#middlewares" class="anchor"></a>Middlewares</h3><p>A middleware can be inserted in a handler to modify or observe its behavior.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul><div class="odoc-spec"><div class="spec type" id="type-handler" class="anchored"><a href="#type-handler" class="anchor"></a><code><span><span class="keyword">type</span> handler</span><span> = <span><span><a href="../index.html#type-byte_stream">byte_stream</a> <a href="../Request/index.html#type-t">Request.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span>resp:<span>( <span><a href="../Response/index.html#type-t">Response.t</a> <span class="arrow">&#45;&gt;</span></span> unit )</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the <code>resp</code> parameter.</p></div></div><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><a href="#type-handler">handler</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-handler">handler</a></span></code></div><div class="spec-doc"><p>A middleware is a handler transformation.</p><p>It takes the existing handler <code>h</code>, and returns a new one which, given a query, modify it or log it before passing it to <code>h</code>, or fail. It can also log or modify or drop the response.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-nil" class="anchored"><a href="#val-nil" class="anchor"></a><code><span><span class="keyword">val</span> nil : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial middleware that does nothing.</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Middleware (tiny_httpd.Tiny_httpd_server.Middleware)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Middleware</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Middleware</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#middlewares">Middlewares</a></li></ul></nav><div class="odoc-content"><h3 id="middlewares"><a href="#middlewares" class="anchor"></a>Middlewares</h3><p>A middleware can be inserted in a handler to modify or observe its behavior.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul><div class="odoc-spec"><div class="spec type anchored" id="type-handler"><a href="#type-handler" class="anchor"></a><code><span><span class="keyword">type</span> handler</span><span> = <span><span><a href="../index.html#type-byte_stream">byte_stream</a> <a href="../Request/index.html#type-t">Request.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span>resp:<span>(<span><a href="../Response/index.html#type-t">Response.t</a> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Handlers are functions returning a response to a request. The response can be delayed, hence the use of a continuation as the <code>resp</code> parameter.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span><a href="#type-handler">handler</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-handler">handler</a></span></code></div><div class="spec-doc"><p>A middleware is a handler transformation.</p><p>It takes the existing handler <code>h</code>, and returns a new one which, given a query, modify it or log it before passing it to <code>h</code>, or fail. It can also log or modify or drop the response.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-nil"><a href="#val-nil" class="anchor"></a><code><span><span class="keyword">val</span> nil : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial middleware that does nothing.</p></div></div></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

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Response_code (tiny_httpd.Tiny_httpd_server.Response_code)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Response_code</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Response_code</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = int</span></code></div><div class="spec-doc"><p>A standard HTTP code.</p><p>https://tools.ietf.org/html/rfc7231#section-6</p></div></div><div class="odoc-spec"><div class="spec value" id="val-ok" class="anchored"><a href="#val-ok" class="anchor"></a><code><span><span class="keyword">val</span> ok : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>The code <code>200</code></p></div></div><div class="odoc-spec"><div class="spec value" id="val-not_found" class="anchored"><a href="#val-not_found" class="anchor"></a><code><span><span class="keyword">val</span> not_found : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>The code <code>404</code></p></div></div><div class="odoc-spec"><div class="spec value" id="val-descr" class="anchored"><a href="#val-descr" class="anchor"></a><code><span><span class="keyword">val</span> descr : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>A description of some of the error codes. NOTE: this is not complete (yet).</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Response_code (tiny_httpd.Tiny_httpd_server.Response_code)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; Response_code</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_server.Response_code</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = int</span></code></div><div class="spec-doc"><p>A standard HTTP code.</p><p>https://tools.ietf.org/html/rfc7231#section-6</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ok"><a href="#val-ok" class="anchor"></a><code><span><span class="keyword">val</span> ok : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>The code <code>200</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-not_found"><a href="#val-not_found" class="anchor"></a><code><span><span class="keyword">val</span> not_found : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>The code <code>404</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-descr"><a href="#val-descr" class="anchor"></a><code><span><span class="keyword">val</span> descr : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>A description of some of the error codes. NOTE: this is not complete (yet).</p></div></div></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

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SERVER_SENT_GENERATOR (tiny_httpd.Tiny_httpd_server.SERVER_SENT_GENERATOR)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; SERVER_SENT_GENERATOR</nav><header class="odoc-preamble"><h1>Module type <code><span>Tiny_httpd_server.SERVER_SENT_GENERATOR</span></code></h1><p>A server-side function to generate of Server-sent events.</p><p>See <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">the w3c page</a> and <a href="https://jvns.ca/blog/2021/01/12/day-36--server-sent-events-are-cool--and-a-fun-bug/">this blog post</a>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-set_headers" class="anchored"><a href="#val-set_headers" class="anchor"></a><code><span><span class="keyword">val</span> set_headers : <span><a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Set headers of the response. This is not mandatory but if used at all, it must be called before any call to <a href="#val-send_event"><code>send_event</code></a> (once events are sent the response is already sent too).</p></div></div><div class="odoc-spec"><div class="spec value" id="val-send_event" class="anchored"><a href="#val-send_event" class="anchor"></a><code><span><span class="keyword">val</span> send_event :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SERVER_SENT_GENERATOR (tiny_httpd.Tiny_httpd_server.SERVER_SENT_GENERATOR)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">tiny_httpd</a> &#x00BB; <a href="../index.html">Tiny_httpd_server</a> &#x00BB; SERVER_SENT_GENERATOR</nav><header class="odoc-preamble"><h1>Module type <code><span>Tiny_httpd_server.SERVER_SENT_GENERATOR</span></code></h1><p>A server-side function to generate of Server-sent events.</p><p>See <a href="https://html.spec.whatwg.org/multipage/server-sent-events.html">the w3c page</a> and <a href="https://jvns.ca/blog/2021/01/12/day-36--server-sent-events-are-cool--and-a-fun-bug/">this blog post</a>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-set_headers"><a href="#val-set_headers" class="anchor"></a><code><span><span class="keyword">val</span> set_headers : <span><a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Set headers of the response. This is not mandatory but if used at all, it must be called before any call to <a href="#val-send_event"><code>send_event</code></a> (once events are sent the response is already sent too).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-send_event"><a href="#val-send_event" class="anchor"></a><code><span><span class="keyword">val</span> send_event :
<span>?event:string <span class="arrow">&#45;&gt;</span></span>
<span>?id:string <span class="arrow">&#45;&gt;</span></span>
<span>?retry:string <span class="arrow">&#45;&gt;</span></span>
<span>data:string <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
unit</span></code></div><div class="spec-doc"><p>Send an event from the server. If data is a multiline string, it will be sent on separate &quot;data:&quot; lines.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-close" class="anchored"><a href="#val-close" class="anchor"></a><code><span><span class="keyword">val</span> close : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Close connection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div></div></body></html>
unit</span></code></div><div class="spec-doc"><p>Send an event from the server. If data is a multiline string, it will be sent on separate &quot;data:&quot; lines.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-close"><a href="#val-close" class="anchor"></a><code><span><span class="keyword">val</span> close : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Close connection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_util (tiny_httpd.Tiny_httpd_util)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd</a> &#x00BB; Tiny_httpd_util</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_util</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#some-utils-for-writing-web-servers">Some utils for writing web servers</a></li></ul></nav><div class="odoc-content"><h2 id="some-utils-for-writing-web-servers"><a href="#some-utils-for-writing-web-servers" class="anchor"></a>Some utils for writing web servers</h2><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.2</li></ul><div class="odoc-spec"><div class="spec value" id="val-percent_encode" class="anchored"><a href="#val-percent_encode" class="anchor"></a><code><span><span class="keyword">val</span> percent_encode : <span>?skip:<span>( <span>char <span class="arrow">&#45;&gt;</span></span> bool )</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">skip</span> <p>if provided, allows to preserve some characters, e.g. '/' in a path.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-percent_decode" class="anchored"><a href="#val-percent_decode" class="anchor"></a><code><span><span class="keyword">val</span> percent_decode : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p>Inverse operation of <a href="#val-percent_encode"><code>percent_encode</code></a>. Can fail since some strings are not valid percent encodings.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-split_query" class="anchored"><a href="#val-split_query" class="anchor"></a><code><span><span class="keyword">val</span> split_query : <span>string <span class="arrow">&#45;&gt;</span></span> string * string</span></code></div><div class="spec-doc"><p>Split a path between the path and the query</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-split_on_slash" class="anchored"><a href="#val-split_on_slash" class="anchor"></a><code><span><span class="keyword">val</span> split_on_slash : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string list</span></span></code></div><div class="spec-doc"><p>Split a string on <code>'/'</code>, remove the trailing <code>'/'</code> if any.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.6</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-get_non_query_path" class="anchored"><a href="#val-get_non_query_path" class="anchor"></a><code><span><span class="keyword">val</span> get_non_query_path : <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>get the part of the path that is not the query parameters.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-get_query" class="anchored"><a href="#val-get_query" class="anchor"></a><code><span><span class="keyword">val</span> get_query : <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Obtain the query part of a path.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.4</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-parse_query" class="anchored"><a href="#val-parse_query" class="anchor"></a><code><span><span class="keyword">val</span> parse_query : <span>string <span class="arrow">&#45;&gt;</span></span> <span><span>( <span><span>(string * string)</span> list</span>, string )</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>Parse a query as a list of <code>'&amp;'</code> or <code>';'</code> separated <code>key=value</code> pairs. The order might not be preserved.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.3</li></ul></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_util (tiny_httpd.Tiny_httpd_util)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd</a> &#x00BB; Tiny_httpd_util</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_util</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#some-utils-for-writing-web-servers">Some utils for writing web servers</a></li></ul></nav><div class="odoc-content"><h2 id="some-utils-for-writing-web-servers"><a href="#some-utils-for-writing-web-servers" class="anchor"></a>Some utils for writing web servers</h2><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.2</li></ul><div class="odoc-spec"><div class="spec value anchored" id="val-percent_encode"><a href="#val-percent_encode" class="anchor"></a><code><span><span class="keyword">val</span> percent_encode : <span>?skip:<span>(<span>char <span class="arrow">&#45;&gt;</span></span> bool)</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">skip</span> <p>if provided, allows to preserve some characters, e.g. '/' in a path.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-percent_decode"><a href="#val-percent_decode" class="anchor"></a><code><span><span class="keyword">val</span> percent_decode : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p>Inverse operation of <a href="#val-percent_encode"><code>percent_encode</code></a>. Can fail since some strings are not valid percent encodings.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-split_query"><a href="#val-split_query" class="anchor"></a><code><span><span class="keyword">val</span> split_query : <span>string <span class="arrow">&#45;&gt;</span></span> string * string</span></code></div><div class="spec-doc"><p>Split a path between the path and the query</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-split_on_slash"><a href="#val-split_on_slash" class="anchor"></a><code><span><span class="keyword">val</span> split_on_slash : <span>string <span class="arrow">&#45;&gt;</span></span> <span>string list</span></span></code></div><div class="spec-doc"><p>Split a string on <code>'/'</code>, remove the trailing <code>'/'</code> if any.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.6</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_non_query_path"><a href="#val-get_non_query_path" class="anchor"></a><code><span><span class="keyword">val</span> get_non_query_path : <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>get the part of the path that is not the query parameters.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_query"><a href="#val-get_query" class="anchor"></a><code><span><span class="keyword">val</span> get_query : <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Obtain the query part of a path.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.4</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-parse_query"><a href="#val-parse_query" class="anchor"></a><code><span><span class="keyword">val</span> parse_query : <span>string <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span>(string * string)</span> list</span>, string)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>Parse a query as a list of <code>'&amp;'</code> or <code>';'</code> separated <code>key=value</code> pairs. The order might not be preserved.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.3</li></ul></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> tiny_httpd</nav><header class="odoc-preamble"><h1 id="tiny_httpd-index"><a href="#tiny_httpd-index" class="anchor"></a>tiny_httpd index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd">Library tiny_httpd</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd"><a href="#library-tiny_httpd" class="anchor"></a>Library tiny_httpd</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Tiny_httpd/index.html"><code>Tiny_httpd</code></a> </li><li><a href="Tiny_httpd_buf/index.html"><code>Tiny_httpd_buf</code></a> <span class="synopsis">Simple buffer.</span></li><li><a href="Tiny_httpd_dir/index.html"><code>Tiny_httpd_dir</code></a> <span class="synopsis">Serving static content from directories</span></li><li><a href="Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a> <span class="synopsis">HTML combinators.</span></li><li><a href="Tiny_httpd_html_/index.html"><code>Tiny_httpd_html_</code></a> </li><li><a href="Tiny_httpd_server/index.html"><code>Tiny_httpd_server</code></a> <span class="synopsis">HTTP server.</span></li><li><a href="Tiny_httpd_stream/index.html"><code>Tiny_httpd_stream</code></a> <span class="synopsis">Byte streams.</span></li><li><a href="Tiny_httpd_util/index.html"><code>Tiny_httpd_util</code></a> </li></ul></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> tiny_httpd</nav><header class="odoc-preamble"><h1 id="tiny_httpd-index"><a href="#tiny_httpd-index" class="anchor"></a>tiny_httpd index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd">Library tiny_httpd</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd"><a href="#library-tiny_httpd" class="anchor"></a>Library tiny_httpd</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Tiny_httpd/index.html"><code>Tiny_httpd</code></a> </li><li><a href="Tiny_httpd_buf/index.html"><code>Tiny_httpd_buf</code></a> <span class="synopsis">Simple buffer.</span></li><li><a href="Tiny_httpd_dir/index.html"><code>Tiny_httpd_dir</code></a> <span class="synopsis">Serving static content from directories</span></li><li><a href="Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a> <span class="synopsis">HTML combinators.</span></li><li><a href="Tiny_httpd_html_/index.html"><code>Tiny_httpd_html_</code></a> </li><li><a href="Tiny_httpd_server/index.html"><code>Tiny_httpd_server</code></a> <span class="synopsis">HTTP server.</span></li><li><a href="Tiny_httpd_stream/index.html"><code>Tiny_httpd_stream</code></a> <span class="synopsis">Byte streams.</span></li><li><a href="Tiny_httpd_util/index.html"><code>Tiny_httpd_util</code></a> </li></ul></div></body></html>

View file

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd_camlzip</a> &#x00BB; Tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_camlzip</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-middleware" class="anchored"><a href="#val-middleware" class="anchor"></a><code><span><span class="keyword">val</span> middleware :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd_camlzip</a> &#x00BB; Tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_camlzip</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-middleware"><a href="#val-middleware" class="anchor"></a><code><span><span class="keyword">val</span> middleware :
<span>?compress_above:int <span class="arrow">&#45;&gt;</span></span>
<span>?buf_size:int <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
<a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware responsible for deflate compression/decompression.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div><div class="odoc-spec"><div class="spec value" id="val-setup" class="anchored"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup : <span>?compress_above:int <span class="arrow">&#45;&gt;</span></span> <span>?buf_size:int <span class="arrow">&#45;&gt;</span></span> <span><a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold above with string responses are compressed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul></div></div></div></body></html>
<a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware responsible for deflate compression/decompression.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup : <span>?compress_above:int <span class="arrow">&#45;&gt;</span></span> <span>?buf_size:int <span class="arrow">&#45;&gt;</span></span> <span><a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold above with string responses are compressed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd_camlzip.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1 id="tiny_httpd_camlzip-index"><a href="#tiny_httpd_camlzip-index" class="anchor"></a>tiny_httpd_camlzip index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd_camlzip">Library tiny_httpd_camlzip</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd_camlzip"><a href="#library-tiny_httpd_camlzip" class="anchor"></a>Library tiny_httpd_camlzip</h2><p>The entry point of this library is the module: <a href="Tiny_httpd_camlzip/index.html"><code>Tiny_httpd_camlzip</code></a>.</p></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (tiny_httpd_camlzip.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1 id="tiny_httpd_camlzip-index"><a href="#tiny_httpd_camlzip-index" class="anchor"></a>tiny_httpd_camlzip index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-tiny_httpd_camlzip">Library tiny_httpd_camlzip</a></li></ul></nav><div class="odoc-content"><h2 id="library-tiny_httpd_camlzip"><a href="#library-tiny_httpd_camlzip" class="anchor"></a>Library tiny_httpd_camlzip</h2><p>The entry point of this library is the module: <a href="Tiny_httpd_camlzip/index.html"><code>Tiny_httpd_camlzip</code></a>.</p></div></body></html>