Added docs for cpl.dependency_injection
This commit is contained in:
parent
9026f021ed
commit
4adf6bc834
BIN
docs/build/doctrees/cpl.database.connection.doctree
vendored
BIN
docs/build/doctrees/cpl.database.connection.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/cpl.database.context.doctree
vendored
BIN
docs/build/doctrees/cpl.database.context.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/cpl.database.doctree
vendored
BIN
docs/build/doctrees/cpl.database.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/cpl.dependency_injection.doctree
vendored
BIN
docs/build/doctrees/cpl.dependency_injection.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/environment.pickle
vendored
BIN
docs/build/doctrees/environment.pickle
vendored
Binary file not shown.
5
docs/build/html/cpl.database.connection.html
vendored
5
docs/build/html/cpl.database.connection.html
vendored
@ -189,6 +189,10 @@
|
|||||||
<dt id="cpl.database.connection.database_connection.DatabaseConnection">
|
<dt id="cpl.database.connection.database_connection.DatabaseConnection">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.connection.database_connection.</span></code><code class="sig-name descname"><span class="pre">DatabaseConnection</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">database_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection.DatabaseConnection" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.connection.database_connection.</span></code><code class="sig-name descname"><span class="pre">DatabaseConnection</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">database_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection.DatabaseConnection" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <a class="reference internal" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC" title="cpl.database.connection.database_connection_abc.DatabaseConnectionABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.connection.database_connection_abc.DatabaseConnectionABC</span></code></a></p>
|
<dd><p>Bases: <a class="reference internal" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC" title="cpl.database.connection.database_connection_abc.DatabaseConnectionABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.connection.database_connection_abc.DatabaseConnectionABC</span></code></a></p>
|
||||||
|
<p>Representation of the database connection</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>database_settings: <a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.database.connection.database_connection.DatabaseConnection.connect">
|
<dt id="cpl.database.connection.database_connection.DatabaseConnection.connect">
|
||||||
<code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection.DatabaseConnection.connect" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection.DatabaseConnection.connect" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -220,6 +224,7 @@
|
|||||||
<dt id="cpl.database.connection.database_connection_abc.DatabaseConnectionABC">
|
<dt id="cpl.database.connection.database_connection_abc.DatabaseConnectionABC">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.connection.database_connection_abc.</span></code><code class="sig-name descname"><span class="pre">DatabaseConnectionABC</span></code><a class="headerlink" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.connection.database_connection_abc.</span></code><code class="sig-name descname"><span class="pre">DatabaseConnectionABC</span></code><a class="headerlink" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
||||||
|
<p>ABC for the <a class="reference internal" href="#cpl.database.connection.database_connection.DatabaseConnection" title="cpl.database.connection.database_connection.DatabaseConnection"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.connection.database_connection.DatabaseConnection</span></code></a></p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.database.connection.database_connection_abc.DatabaseConnectionABC.connect">
|
<dt id="cpl.database.connection.database_connection_abc.DatabaseConnectionABC.connect">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC.connect" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.connection.database_connection_abc.DatabaseConnectionABC.connect" title="Permalink to this definition">¶</a></dt>
|
||||||
|
5
docs/build/html/cpl.database.context.html
vendored
5
docs/build/html/cpl.database.context.html
vendored
@ -189,6 +189,10 @@
|
|||||||
<dt id="cpl.database.context.database_context.DatabaseContext">
|
<dt id="cpl.database.context.database_context.DatabaseContext">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.context.database_context.</span></code><code class="sig-name descname"><span class="pre">DatabaseContext</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">database_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context.DatabaseContext" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.context.database_context.</span></code><code class="sig-name descname"><span class="pre">DatabaseContext</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">database_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context.DatabaseContext" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <a class="reference internal" href="#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></code></a></p>
|
<dd><p>Bases: <a class="reference internal" href="#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></code></a></p>
|
||||||
|
<p>Representation of the database context</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>database_settings: <a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.database.context.database_context.DatabaseContext.connect">
|
<dt id="cpl.database.context.database_context.DatabaseContext.connect">
|
||||||
<code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context.DatabaseContext.connect" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context.DatabaseContext.connect" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -226,6 +230,7 @@
|
|||||||
<dt id="cpl.database.context.database_context_abc.DatabaseContextABC">
|
<dt id="cpl.database.context.database_context_abc.DatabaseContextABC">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.context.database_context_abc.</span></code><code class="sig-name descname"><span class="pre">DatabaseContextABC</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context_abc.DatabaseContextABC" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.context.database_context_abc.</span></code><code class="sig-name descname"><span class="pre">DatabaseContextABC</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context_abc.DatabaseContextABC" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
||||||
|
<p>ABC for the <a class="reference internal" href="#cpl.database.context.database_context.DatabaseContext" title="cpl.database.context.database_context.DatabaseContext"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context.DatabaseContext</span></code></a></p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.database.context.database_context_abc.DatabaseContextABC.connect">
|
<dt id="cpl.database.context.database_context_abc.DatabaseContextABC.connect">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context_abc.DatabaseContextABC.connect" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connection_string</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.database.context.database_context_abc.DatabaseContextABC.connect" title="Permalink to this definition">¶</a></dt>
|
||||||
|
1
docs/build/html/cpl.database.html
vendored
1
docs/build/html/cpl.database.html
vendored
@ -203,6 +203,7 @@
|
|||||||
<dt id="cpl.database.database_settings.DatabaseSettings">
|
<dt id="cpl.database.database_settings.DatabaseSettings">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.database_settings.</span></code><code class="sig-name descname"><span class="pre">DatabaseSettings</span></code><a class="headerlink" href="#cpl.database.database_settings.DatabaseSettings" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.database.database_settings.</span></code><code class="sig-name descname"><span class="pre">DatabaseSettings</span></code><a class="headerlink" href="#cpl.database.database_settings.DatabaseSettings" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_model_abc.ConfigurationModelABC" title="cpl.configuration.configuration_model_abc.ConfigurationModelABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.configuration.configuration_model_abc.ConfigurationModelABC</span></code></a></p>
|
<dd><p>Bases: <a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_model_abc.ConfigurationModelABC" title="cpl.configuration.configuration_model_abc.ConfigurationModelABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.configuration.configuration_model_abc.ConfigurationModelABC</span></code></a></p>
|
||||||
|
<p>Represents settings for the database connection</p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.database.database_settings.DatabaseSettings.auth_plugin">
|
<dt id="cpl.database.database_settings.DatabaseSettings.auth_plugin">
|
||||||
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">auth_plugin</span></code><a class="headerlink" href="#cpl.database.database_settings.DatabaseSettings.auth_plugin" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">auth_plugin</span></code><a class="headerlink" href="#cpl.database.database_settings.DatabaseSettings.auth_plugin" title="Permalink to this definition">¶</a></dt>
|
||||||
|
146
docs/build/html/cpl.dependency_injection.html
vendored
146
docs/build/html/cpl.dependency_injection.html
vendored
@ -183,13 +183,15 @@
|
|||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_collection.</span></code><code class="sig-name descname"><span class="pre">ServiceCollection</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_abc.ConfigurationABC" title="cpl.configuration.configuration_abc.ConfigurationABC"><span class="pre">cpl.configuration.configuration_abc.ConfigurationABC</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_collection.</span></code><code class="sig-name descname"><span class="pre">ServiceCollection</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_abc.ConfigurationABC" title="cpl.configuration.configuration_abc.ConfigurationABC"><span class="pre">cpl.configuration.configuration_abc.ConfigurationABC</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <a class="reference internal" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC" title="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_collection_abc.ServiceCollectionABC</span></code></a></p>
|
<dd><p>Bases: <a class="reference internal" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC" title="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_collection_abc.ServiceCollectionABC</span></code></a></p>
|
||||||
|
<p>Representation of the collection of services</p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_db_context">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_db_context">
|
||||||
<code class="sig-name descname"><span class="pre">add_db_context</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_context_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_db_context" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">add_db_context</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_context_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_db_context" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds database context
|
<dd><p>Adds database context</p>
|
||||||
:param db_context:
|
<blockquote>
|
||||||
:param db_settings:
|
<div><p>db_context: Type[<a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></code></a>]
|
||||||
:return:</p>
|
db_settings: <a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
@ -201,34 +203,40 @@
|
|||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_scoped">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_scoped">
|
||||||
<code class="sig-name descname"><span class="pre">add_scoped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_scoped" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">add_scoped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_scoped" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with scoped lifetime
|
<dd><p>Adds a service with scoped lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_singleton">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_singleton">
|
||||||
<code class="sig-name descname"><span class="pre">add_singleton</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_singleton" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">add_singleton</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_singleton" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with singleton lifetime
|
<dd><p>Adds a service with singleton lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_transient">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.add_transient">
|
||||||
<code class="sig-name descname"><span class="pre">add_transient</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_transient" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">add_transient</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.add_transient" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with transient lifetime
|
<dd><p>Adds a service with transient lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.build_service_provider">
|
<dt id="cpl.dependency_injection.service_collection.ServiceCollection.build_service_provider">
|
||||||
<code class="sig-name descname"><span class="pre">build_service_provider</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span> → <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></a><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.build_service_provider" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">build_service_provider</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span> → <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></a><a class="headerlink" href="#cpl.dependency_injection.service_collection.ServiceCollection.build_service_provider" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Creates instance of the service provider</p>
|
<dd><p>Creates instance of the service provider</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of type <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
@ -240,13 +248,15 @@
|
|||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_collection_abc.</span></code><code class="sig-name descname"><span class="pre">ServiceCollectionABC</span></code><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_collection_abc.</span></code><code class="sig-name descname"><span class="pre">ServiceCollectionABC</span></code><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
||||||
|
<p>ABC for the class <a class="reference internal" href="#cpl.dependency_injection.service_collection.ServiceCollection" title="cpl.dependency_injection.service_collection.ServiceCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_collection.ServiceCollection</span></code></a></p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_db_context">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_db_context">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_db_context</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_context</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_db_context" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_db_context</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">db_context</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_settings</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_db_context" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds database context
|
<dd><p>Adds database context</p>
|
||||||
:param db_context:
|
<blockquote>
|
||||||
:param db_settings:
|
<div><p>db_context: Type[<a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></code></a>]
|
||||||
:return:</p>
|
db_settings: <a class="reference internal" href="cpl.database.html#cpl.database.database_settings.DatabaseSettings" title="cpl.database.database_settings.DatabaseSettings"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.database_settings.DatabaseSettings</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
@ -258,34 +268,40 @@
|
|||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_scoped">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_scoped">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_scoped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_scoped" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_scoped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_scoped" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with scoped lifetime
|
<dd><p>Adds a service with scoped lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_singleton">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_singleton">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_singleton</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_singleton" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_singleton</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_singleton" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with singleton lifetime
|
<dd><p>Adds a service with singleton lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_transient">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_transient">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_transient</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_transient" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_transient</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.add_transient" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Adds a service with transient lifetime
|
<dd><p>Adds a service with transient lifetime</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:param service:
|
<div><p>service_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code>
|
||||||
:return:</p>
|
service: <code class="xref py py-class docutils literal notranslate"><span class="pre">Callable</span></code></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.build_service_provider">
|
<dt id="cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.build_service_provider">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">build_service_provider</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span> → <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></a><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.build_service_provider" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">build_service_provider</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span> → <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></a><a class="headerlink" href="#cpl.dependency_injection.service_collection_abc.ServiceCollectionABC.build_service_provider" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Creates instance of the service provider</p>
|
<dd><p>Creates instance of the service provider</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of type <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
@ -297,6 +313,11 @@
|
|||||||
<dt id="cpl.dependency_injection.service_descriptor.ServiceDescriptor">
|
<dt id="cpl.dependency_injection.service_descriptor.ServiceDescriptor">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_descriptor.</span></code><code class="sig-name descname"><span class="pre">ServiceDescriptor</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">implementation</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lifetime</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="#cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum" title="cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum"><span class="pre">cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_descriptor.ServiceDescriptor" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_descriptor.</span></code><code class="sig-name descname"><span class="pre">ServiceDescriptor</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">implementation</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">type</span><span class="p"><span class="pre">,</span> </span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lifetime</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="#cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum" title="cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum"><span class="pre">cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum</span></a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_descriptor.ServiceDescriptor" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||||||
|
<p>Descriptor of a service</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>implementation: Union[<code class="xref py py-class docutils literal notranslate"><span class="pre">type</span></code>, Optional[<code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code>]]
|
||||||
|
lifetime: <a class="reference internal" href="#cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum" title="cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum</span></code></a></p>
|
||||||
|
</div></blockquote>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_descriptor.ServiceDescriptor.implementation">
|
<dt id="cpl.dependency_injection.service_descriptor.ServiceDescriptor.implementation">
|
||||||
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">implementation</span></code><a class="headerlink" href="#cpl.dependency_injection.service_descriptor.ServiceDescriptor.implementation" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">implementation</span></code><a class="headerlink" href="#cpl.dependency_injection.service_descriptor.ServiceDescriptor.implementation" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -346,20 +367,40 @@
|
|||||||
<dt id="cpl.dependency_injection.service_provider.ServiceProvider">
|
<dt id="cpl.dependency_injection.service_provider.ServiceProvider">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_provider.</span></code><code class="sig-name descname"><span class="pre">ServiceProvider</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_descriptors</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_abc.ConfigurationABC" title="cpl.configuration.configuration_abc.ConfigurationABC"><span class="pre">cpl.configuration.configuration_abc.ConfigurationABC</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_context</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_provider.</span></code><code class="sig-name descname"><span class="pre">ServiceProvider</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_descriptors</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_abc.ConfigurationABC" title="cpl.configuration.configuration_abc.ConfigurationABC"><span class="pre">cpl.configuration.configuration_abc.ConfigurationABC</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">db_context</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></code></a></p>
|
<dd><p>Bases: <a class="reference internal" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="cpl.dependency_injection.service_provider_abc.ServiceProviderABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_provider_abc.ServiceProviderABC</span></code></a></p>
|
||||||
|
<p>Provider for the services</p>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>service_descriptors: list[<a class="reference internal" href="#cpl.dependency_injection.service_descriptor.ServiceDescriptor" title="cpl.dependency_injection.service_descriptor.ServiceDescriptor"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_descriptor.ServiceDescriptor</span></code></a>]
|
||||||
|
config: <a class="reference internal" href="cpl.configuration.html#cpl.configuration.configuration_abc.ConfigurationABC" title="cpl.configuration.configuration_abc.ConfigurationABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.configuration.configuration_abc.ConfigurationABC</span></code></a>
|
||||||
|
db_context: Optional[<a class="reference internal" href="cpl.database.context.html#cpl.database.context.database_context_abc.DatabaseContextABC" title="cpl.database.context.database_context_abc.DatabaseContextABC"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.database.context.database_context_abc.DatabaseContextABC</span></code></a>]</p>
|
||||||
|
</div></blockquote>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_provider.ServiceProvider.build_service">
|
<dt id="cpl.dependency_injection.service_provider.ServiceProvider.build_service">
|
||||||
<code class="sig-name descname"><span class="pre">build_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span> → <span class="pre">object</span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider.build_service" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">build_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span> → <span class="pre">object</span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider.build_service" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Creates instance of given type
|
<dd><p>Creates instance of given type</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:return:</p>
|
<div><dl class="simple">
|
||||||
|
<dt>instance_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code></dt><dd><p>The type of the searched instance</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div></blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of the given type</p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_provider.ServiceProvider.get_service">
|
<dt id="cpl.dependency_injection.service_provider.ServiceProvider.get_service">
|
||||||
<code class="sig-name descname"><span class="pre">get_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span> → <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider.get_service" title="Permalink to this definition">¶</a></dt>
|
<code class="sig-name descname"><span class="pre">get_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span> → <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><a class="headerlink" href="#cpl.dependency_injection.service_provider.ServiceProvider.get_service" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Returns instance of given type
|
<dd><p>Returns instance of given type</p>
|
||||||
:param instance_type:
|
<blockquote>
|
||||||
:return:</p>
|
<div><dl class="simple">
|
||||||
|
<dt>instance_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code></dt><dd><p>The type of the searched instance</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div></blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of type Optional[Callable[<code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code>]]</p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
@ -371,20 +412,35 @@
|
|||||||
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC">
|
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC">
|
||||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_provider_abc.</span></code><code class="sig-name descname"><span class="pre">ServiceProviderABC</span></code><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">cpl.dependency_injection.service_provider_abc.</span></code><code class="sig-name descname"><span class="pre">ServiceProviderABC</span></code><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
|
||||||
|
<p>ABC for the class <a class="reference internal" href="#cpl.dependency_injection.service_provider.ServiceProvider" title="cpl.dependency_injection.service_provider.ServiceProvider"><code class="xref py py-class docutils literal notranslate"><span class="pre">cpl.dependency_injection.service_provider.ServiceProvider</span></code></a></p>
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC.build_service">
|
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC.build_service">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">build_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span> → <span class="pre">object</span><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC.build_service" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">build_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em><span class="sig-paren">)</span> → <span class="pre">object</span><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC.build_service" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Creates instance of given type
|
<dd><p>Creates instance of given type</p>
|
||||||
:param service_type:
|
<blockquote>
|
||||||
:return:</p>
|
<div><dl class="simple">
|
||||||
|
<dt>instance_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code></dt><dd><p>The type of the searched instance</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div></blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of the given type</p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="py method">
|
<dl class="py method">
|
||||||
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC.get_service">
|
<dt id="cpl.dependency_injection.service_provider_abc.ServiceProviderABC.get_service">
|
||||||
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">get_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">instance_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em><span class="sig-paren">)</span> → <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC.get_service" title="Permalink to this definition">¶</a></dt>
|
<em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">get_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">instance_type</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Type</span></span></em><span class="sig-paren">)</span> → <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">collections.abc.Callable</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><a class="headerlink" href="#cpl.dependency_injection.service_provider_abc.ServiceProviderABC.get_service" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Returns instance of given type
|
<dd><p>Returns instance of given type</p>
|
||||||
:param instance_type:
|
<blockquote>
|
||||||
:return:</p>
|
<div><dl class="simple">
|
||||||
|
<dt>instance_type: <code class="xref py py-class docutils literal notranslate"><span class="pre">Type</span></code></dt><dd><p>The type of the searched instance</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div></blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<div><p>Object of type Optional[Callable[<code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code>]]</p>
|
||||||
|
</div></blockquote>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
2
docs/build/html/searchindex.js
vendored
2
docs/build/html/searchindex.js
vendored
File diff suppressed because one or more lines are too long
@ -14,6 +14,7 @@ from cpl.utils.credential_manager import CredentialManager
|
|||||||
|
|
||||||
|
|
||||||
class ServiceCollection(ServiceCollectionABC):
|
class ServiceCollection(ServiceCollectionABC):
|
||||||
|
r"""Representation of the collection of services"""
|
||||||
|
|
||||||
def __init__(self, config: ConfigurationABC):
|
def __init__(self, config: ConfigurationABC):
|
||||||
ServiceCollectionABC.__init__(self)
|
ServiceCollectionABC.__init__(self)
|
||||||
|
@ -8,64 +8,67 @@ from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
|
|||||||
|
|
||||||
|
|
||||||
class ServiceCollectionABC(ABC):
|
class ServiceCollectionABC(ABC):
|
||||||
|
r"""ABC for the class :class:`cpl.dependency_injection.service_collection.ServiceCollection`"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
|
||||||
ABC for service providing
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_db_context(self, db_context: Type[DatabaseContextABC], db_settings: DatabaseSettings):
|
def add_db_context(self, db_context: Type[DatabaseContextABC], db_settings: DatabaseSettings):
|
||||||
"""
|
r"""Adds database context
|
||||||
Adds database context
|
|
||||||
:param db_context:
|
Parameter
|
||||||
:param db_settings:
|
---------
|
||||||
:return:
|
db_context: Type[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
||||||
|
db_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_logging(self):
|
def add_logging(self):
|
||||||
"""
|
r"""Adds the CPL internal logger"""
|
||||||
Adds the CPL internal logger
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_transient(self, service_type: Type, service: Callable = None):
|
def add_transient(self, service_type: Type, service: Callable = None):
|
||||||
"""
|
r"""Adds a service with transient lifetime
|
||||||
Adds a service with transient lifetime
|
|
||||||
:param service_type:
|
Parameter
|
||||||
:param service:
|
---------
|
||||||
:return:
|
service_type: :class:`Type`
|
||||||
|
service: :class:`Callable`
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_scoped(self, service_type: Type, service: Callable = None):
|
def add_scoped(self, service_type: Type, service: Callable = None):
|
||||||
"""
|
r"""Adds a service with scoped lifetime
|
||||||
Adds a service with scoped lifetime
|
|
||||||
:param service_type:
|
Parameter
|
||||||
:param service:
|
---------
|
||||||
:return:
|
service_type: :class:`Type`
|
||||||
|
service: :class:`Callable`
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_singleton(self, service_type: Type, service: Callable = None):
|
def add_singleton(self, service_type: Type, service: Callable = None):
|
||||||
"""
|
r"""Adds a service with singleton lifetime
|
||||||
Adds a service with singleton lifetime
|
|
||||||
:param service_type:
|
Parameter
|
||||||
:param service:
|
---------
|
||||||
:return:
|
service_type: :class:`Type`
|
||||||
|
service: :class:`Callable`
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def build_service_provider(self) -> ServiceProviderABC:
|
def build_service_provider(self) -> ServiceProviderABC:
|
||||||
"""
|
r"""Creates instance of the service provider
|
||||||
Creates instance of the service provider
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
Object of type :class:`cpl.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
@ -4,6 +4,13 @@ from cpl.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
|||||||
|
|
||||||
|
|
||||||
class ServiceDescriptor:
|
class ServiceDescriptor:
|
||||||
|
r"""Descriptor of a service
|
||||||
|
|
||||||
|
Parameter
|
||||||
|
---------
|
||||||
|
implementation: Union[:class:`type`, Optional[:class:`object`]]
|
||||||
|
lifetime: :class:`cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, implementation: Union[type, Optional[object]], lifetime: ServiceLifetimeEnum):
|
def __init__(self, implementation: Union[type, Optional[object]], lifetime: ServiceLifetimeEnum):
|
||||||
|
|
||||||
|
@ -12,6 +12,14 @@ from cpl.environment.application_environment_abc import ApplicationEnvironmentAB
|
|||||||
|
|
||||||
|
|
||||||
class ServiceProvider(ServiceProviderABC):
|
class ServiceProvider(ServiceProviderABC):
|
||||||
|
r"""Provider for the services
|
||||||
|
|
||||||
|
Parameter
|
||||||
|
---------
|
||||||
|
service_descriptors: list[:class:`cpl.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||||
|
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
||||||
|
db_context: Optional[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, service_descriptors: list[ServiceDescriptor], config: ConfigurationABC, db_context: Optional[DatabaseContextABC]):
|
def __init__(self, service_descriptors: list[ServiceDescriptor], config: ConfigurationABC, db_context: Optional[DatabaseContextABC]):
|
||||||
ServiceProviderABC.__init__(self)
|
ServiceProviderABC.__init__(self)
|
||||||
|
@ -4,28 +4,38 @@ from typing import Type, Optional
|
|||||||
|
|
||||||
|
|
||||||
class ServiceProviderABC(ABC):
|
class ServiceProviderABC(ABC):
|
||||||
|
r"""ABC for the class :class:`cpl.dependency_injection.service_provider.ServiceProvider`"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
|
||||||
ABC for service providing
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def build_service(self, service_type: type) -> object:
|
def build_service(self, service_type: Type) -> object:
|
||||||
"""
|
r"""Creates instance of given type
|
||||||
Creates instance of given type
|
|
||||||
:param service_type:
|
Parameter
|
||||||
:return:
|
---------
|
||||||
|
instance_type: :class:`Type`
|
||||||
|
The type of the searched instance
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
Object of the given type
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_service(self, instance_type: Type) -> Optional[Callable[object]]:
|
def get_service(self, instance_type: Type) -> Optional[Callable[object]]:
|
||||||
"""
|
r"""Returns instance of given type
|
||||||
Returns instance of given type
|
|
||||||
:param instance_type:
|
Parameter
|
||||||
:return:
|
---------
|
||||||
|
instance_type: :class:`Type`
|
||||||
|
The type of the searched instance
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
Object of type Optional[Callable[:class:`object`]]
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user