ocaml-opentelemetry/opentelemetry-client-ocurl/Opentelemetry_client_ocurl/Config/Env/index.html
2025-07-23 14:08:20 +00:00

13 lines
3.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Env (opentelemetry-client-ocurl.Opentelemetry_client_ocurl.Config.Env)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.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">Index</a> &#x00BB; <a href="../../../index.html">opentelemetry-client-ocurl</a> &#x00BB; <a href="../../index.html">Opentelemetry_client_ocurl</a> &#x00BB; <a href="../index.html">Config</a> &#x00BB; Env</nav><header class="odoc-preamble"><h1>Module <code><span>Config.Env</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-get_debug"><a href="#val-get_debug" class="anchor"></a><code><span><span class="keyword">val</span> get_debug : <span>unit <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_debug"><a href="#val-set_debug" class="anchor"></a><code><span><span class="keyword">val</span> set_debug : <span>bool <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_headers"><a href="#val-get_headers" class="anchor"></a><code><span><span class="keyword">val</span> get_headers : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span>(string * string)</span> list</span></span></code></div></div><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><span><span>(string * string)</span> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make :
<span><span>(<span><a href="../../../../opentelemetry/Opentelemetry_client/Config/index.html#type-t">Opentelemetry_client.Config.t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'a</span> <a href="../../../../opentelemetry/Opentelemetry_client/Config/index.html#type-make">Opentelemetry_client.Config.make</a></span></span></code></div><div class="spec-doc"><p><code>make f</code> is a <code>make</code> function that will give <code>f</code> a safely constructed <a href="../index.html#type-t"><code>t</code></a>.</p><p>Typically this is used to extend the constructor for <a href="../index.html#type-t"><code>t</code></a> with new optional arguments.</p><p>E.g., we can construct a configuration that includes a <a href="../index.html#type-t"><code>t</code></a> alongside a more specific field like so:</p><pre class="language-ocaml"><code> type extended_config = {
new_field: string;
common: t;
}
let make : (new_field:string -&gt; unit -&gt; extended_config) make =
Env.make (fun common ~new_field () -&gt; { new_field; common })
let _example : extended_config =
make ~new_field:&quot;foo&quot; ~url_traces:&quot;foo/bar&quot; ~debug:true ()</code></pre><p>As a special case, we can get the simple constructor function for <a href="../index.html#type-t"><code>t</code></a> with <code>Env.make (fun common () -&gt; common)</code></p></div></div></div></body></html>