Skip to content

Commit

Permalink
Source websocket endpoint dynamically
Browse files Browse the repository at this point in the history
Update requirements.txt
Add a static filepath to template
  • Loading branch information
dormant-user committed Sep 4, 2024
1 parent 7ab9a14 commit a72bf84
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 68 deletions.
7 changes: 6 additions & 1 deletion doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ Models

====

.. autoclass:: pyninja.models.WSSettings(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. autoclass:: pyninja.models.Session(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

Expand All @@ -93,7 +98,7 @@ Models
====

.. automodule:: pyninja.models
:exclude-members: Payload, ServiceStatus, ServiceManager, EnvConfig, Session, RateLimit, env, database
:exclude-members: Payload, ServiceStatus, ServiceManager, WSSettings, EnvConfig, Session, RateLimit, env, database

Squire
======
Expand Down
2 changes: 1 addition & 1 deletion docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>PyNinja &#8212; PyNinja documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
Expand Down
7 changes: 6 additions & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ Models

====

.. autoclass:: pyninja.models.WSSettings(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

====

.. autoclass:: pyninja.models.Session(BaseModel)
:exclude-members: _abc_impl, model_config, model_fields, model_computed_fields

Expand All @@ -93,7 +98,7 @@ Models
====

.. automodule:: pyninja.models
:exclude-members: Payload, ServiceStatus, ServiceManager, EnvConfig, Session, RateLimit, env, database
:exclude-members: Payload, ServiceStatus, ServiceManager, WSSettings, EnvConfig, Session, RateLimit, env, database

Squire
======
Expand Down
21 changes: 5 additions & 16 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ <h3>Navigation</h3>
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#_"><strong>_</strong></a>
| <a href="#A"><strong>A</strong></a>
<a href="#A"><strong>A</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
Expand All @@ -63,14 +62,6 @@ <h1 id="index">Index</h1>
| <a href="#W"><strong>W</strong></a>

</div>
<h2 id="_">_</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.WSSettings._abc_impl">_abc_impl (pyninja.models.WSSettings attribute)</a>
</li>
</ul></td>
</tr></table>

<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down Expand Up @@ -249,12 +240,6 @@ <h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.RateLimit.max_requests">max_requests (pyninja.models.RateLimit attribute)</a>
</li>
<li><a href="index.html#pyninja.models.WSSettings.model_computed_fields">model_computed_fields (pyninja.models.WSSettings attribute)</a>
</li>
<li><a href="index.html#pyninja.models.WSSettings.model_config">model_config (pyninja.models.WSSettings attribute)</a>
</li>
<li><a href="index.html#pyninja.models.WSSettings.model_fields">model_fields (pyninja.models.WSSettings attribute)</a>
</li>
<li>
module
Expand Down Expand Up @@ -465,6 +450,10 @@ <h2 id="S">S</h2>

<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.WSSettings.template">template (pyninja.models.WSSettings attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.Payload.timeout">timeout (pyninja.models.Payload attribute)</a>
</li>
Expand Down
71 changes: 26 additions & 45 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Welcome to PyNinja’s documentation! &#8212; PyNinja documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
Expand Down Expand Up @@ -788,6 +788,31 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"

</dd></dl>

<hr class="docutils" />
<dl class="py class">
<dt class="sig sig-object py" id="pyninja.models.WSSettings">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyninja.models.</span></span><span class="sig-name descname"><span class="pre">WSSettings</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">BaseModel</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyninja.models.WSSettings" title="Permalink to this definition"></a></dt>
<dd><p>Default settings for websocket configuration.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">WSSettings</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.template">
<span class="sig-name descname"><span class="pre">template</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">Path</span></em><a class="headerlink" href="#pyninja.models.WSSettings.template" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.cpu_interval">
<span class="sig-name descname"><span class="pre">cpu_interval</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pyninja.models.WSSettings.cpu_interval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.refresh_interval">
<span class="sig-name descname"><span class="pre">refresh_interval</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pyninja.models.WSSettings.refresh_interval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<hr class="docutils" />
<dl class="py class">
<dt class="sig sig-object py" id="pyninja.models.Session">
Expand Down Expand Up @@ -1003,50 +1028,6 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyninja.models.WSSettings">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyninja.models.</span></span><span class="sig-name descname"><span class="pre">WSSettings</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cpu_interval</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">refresh_interval</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyninja.models.WSSettings" title="Permalink to this definition"></a></dt>
<dd><p>Default settings for websocket configuration.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">WSSettings</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.cpu_interval">
<span class="sig-name descname"><span class="pre">cpu_interval</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pyninja.models.WSSettings.cpu_interval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.refresh_interval">
<span class="sig-name descname"><span class="pre">refresh_interval</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pyninja.models.WSSettings.refresh_interval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings._abc_impl">
<span class="sig-name descname"><span class="pre">_abc_impl</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">&lt;_abc._abc_data</span> <span class="pre">object&gt;</span></em><a class="headerlink" href="#pyninja.models.WSSettings._abc_impl" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.model_computed_fields">
<span class="sig-name descname"><span class="pre">model_computed_fields</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">ComputedFieldInfo</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{}</span></em><a class="headerlink" href="#pyninja.models.WSSettings.model_computed_fields" title="Permalink to this definition"></a></dt>
<dd><p>A dictionary of computed field names and their corresponding <cite>ComputedFieldInfo</cite> objects.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.model_config">
<span class="sig-name descname"><span class="pre">model_config</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span><span class="p"><span class="pre">[</span></span><span class="pre">ConfigDict</span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{}</span></em><a class="headerlink" href="#pyninja.models.WSSettings.model_config" title="Permalink to this definition"></a></dt>
<dd><p>Configuration for the model, should be a dictionary conforming to [<cite>ConfigDict</cite>][pydantic.config.ConfigDict].</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pyninja.models.WSSettings.model_fields">
<span class="sig-name descname"><span class="pre">model_fields</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">FieldInfo</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'cpu_interval':</span> <span class="pre">FieldInfo(annotation=int,</span> <span class="pre">required=False,</span> <span class="pre">default=3,</span> <span class="pre">metadata=[Gt(gt=0)]),</span> <span class="pre">'refresh_interval':</span> <span class="pre">FieldInfo(annotation=int,</span> <span class="pre">required=False,</span> <span class="pre">default=5,</span> <span class="pre">metadata=[Gt(gt=0)])}</span></em><a class="headerlink" href="#pyninja.models.WSSettings.model_fields" title="Permalink to this definition"></a></dt>
<dd><p>Metadata about the fields defined on the model,
mapping of field names to [<cite>FieldInfo</cite>][pydantic.fields.FieldInfo].</p>
<p>This replaces <cite>Model.__fields__</cite> from Pydantic V1.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyninja.models.get_service_manager">
<span class="sig-prename descclassname"><span class="pre">pyninja.models.</span></span><span class="sig-name descname"><span class="pre">get_service_manager</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#pyninja.models.ServiceManager" title="pyninja.models.ServiceManager"><span class="pre">ServiceManager</span></a></span></span><a class="headerlink" href="#pyninja.models.get_service_manager" title="Permalink to this definition"></a></dt>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit a72bf84

Please sign in to comment.