mirror of
https://github.com/zap-proto/ocaml-rpc.git
synced 2026-11-03 13:11:00 +00:00
10 lines
7.3 KiB
HTML
10 lines
7.3 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Vat_config (capnp-rpc-unix.Capnp_rpc_unix.Vat_config)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.4"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">capnp-rpc-unix</a> » <a href="../index.html">Capnp_rpc_unix</a> » Vat_config</nav><header class="odoc-preamble"><h1>Module <code><span>Capnp_rpc_unix.Vat_config</span></code></h1><p>Configuration for a <a href="../Vat/index.html"><code>Vat</code></a>.</p></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><span class="optlabel">?backlog</span>:int <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?public_address</span>:<a href="../Network/Location/index.html#type-t">Network.Location.t</a> <span class="arrow">-></span></span>
|
||
<span><span class="label">secret_key</span>:<span>[< <span>`File of <span><span class="type-var">_</span> <span class="xref-unresolved">Eio</span>.Path.t</span></span> <span><span>| `PEM</span> of string</span> <span>| `Ephemeral</span> ]</span> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?serve_tls</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="label">net</span>:<span><span class="type-var">_</span> <span class="xref-unresolved">Eio</span>.Net.t</span> <span class="arrow">-></span></span>
|
||
<span><a href="../Network/Location/index.html#type-t">Network.Location.t</a> <span class="arrow">-></span></span>
|
||
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>create ~secret_key ~net listen_address</code> is the configuration for a server vat that listens on address <code>listen_address</code>. <code>secret_key</code> may be one of:</p><ul><li><code>`File path</code>: a PEM-encoded RSA private key is read from <code>path</code>. If <code>path</code> doesn't yet exist, a new key is created and stored there.</li><li><code>`PEM data</code>: the given PEM-encoded data is used as the key.</li><li><code>`Ephemeral</code>: a new key is generated (if needed) and not saved anywhere. If <code>serve_tls</code> is <code>false</code> then the vat accepts unencrypted incoming connections. If <code>true</code> (the default), the vat performs a server TLS handshake, using <code>secret_key</code> to prove its identity to clients. <code>backlog</code> is passed to <code>Unix.listen</code>. The vat will suggest that others connect to it at <code>public_address</code> (or <code>listen_address</code> if no public address is given).</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-secret_key"><a href="#val-secret_key" class="anchor"></a><code><span><span class="keyword">val</span> secret_key : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="../../../capnp-rpc-net/Capnp_rpc_net/Auth/Secret_key/index.html#type-t">Capnp_rpc_net.Auth.Secret_key.t</a></span></code></div><div class="spec-doc"><p><code>secret_key t</code> returns the vat's secret yet, generating it if this is the first time it has been used.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-hashed_secret"><a href="#val-hashed_secret" class="anchor"></a><code><span><span class="keyword">val</span> hashed_secret : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> string</span></code></div><div class="spec-doc"><p><code>hashed_secret t</code> is the SHA256 digest of the secret key file. This is useful as an input to <code>Restorer.Id.derived</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-derived_id"><a href="#val-derived_id" class="anchor"></a><code><span><span class="keyword">val</span> derived_id : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <a href="../../../capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html#type-t">Capnp_rpc_net.Restorer.Id.t</a></span></code></div><div class="spec-doc"><p><code>derived_id t name</code> is a secret service ID derived from name and the vat's secret key (using <code>Restorer.Id.derived</code>). It won't change (unless the vat's key changes).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sturdy_uri"><a href="#val-sturdy_uri" class="anchor"></a><code><span><span class="keyword">val</span> sturdy_uri : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="../../../capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html#type-t">Capnp_rpc_net.Restorer.Id.t</a> <span class="arrow">-></span></span> <span class="xref-unresolved">Uri</span>.t</span></code></div><div class="spec-doc"><p><code>sturdy_uri t id</code> is a sturdy URI for <code>id</code> at the vat that would be created by <code>t</code>.</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><a href="#type-t">t</a> <span class="xref-unresolved">Fmt</span>.t</span></span></code></div><div class="spec-doc"><p>This is probably only useful for the unit-tests.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span><span class="keyword">val</span> equal : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p>This is probably only useful for the unit-tests.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-env"><a href="#type-env" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a env</span></span><span> = <span class="type-var">'a</span></span><span> <span class="keyword">constraint</span> <span class="type-var">'a</span> = <span>< net : <span><span class="type-var">_</span> <span class="xref-unresolved">Eio</span>.Net.t</span> ; fs : <span><span class="type-var">_</span> <span class="xref-unresolved">Eio</span>.Path.t</span>.. ></span> <span class="keyword">as</span> 'a</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-cmd"><a href="#val-cmd" class="anchor"></a><code><span><span class="keyword">val</span> cmd : <span><span><span class="type-var">_</span> <a href="#type-env">env</a></span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="xref-unresolved">Cmdliner</span>.Term.t</span></span></code></div><div class="spec-doc"><p><code>cmd env</code> evaluates to a configuration populated from the command-line options.</p></div></div></div></body></html>
|