cpl_core.application package

Submodules

cpl_core.application.application_abc module

class cpl_core.application.application_abc.ApplicationABC(config: ConfigurationABC, services: ServiceProviderABC)

Bases: ABC

ABC for the Application class

Parameters:
config: cpl_core.configuration.configuration_abc.ConfigurationABC

Contains object loaded from appsettings

services: cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC

Contains instances of prepared objects

abstract configure()

Configure the application

Called by cpl_core.application.application_abc.ApplicationABC.run

abstract main()

Custom entry point

Called by cpl_core.application.application_abc.ApplicationABC.run

run()

Entry point

Called by custom Application.main

async run_async()

Entry point

Called by custom Application.main

cpl_core.application.application_builder module

class cpl_core.application.application_builder.ApplicationBuilder(app: Type[ApplicationABC])

Bases: ApplicationBuilderABC

This is class is used to build an object of cpl_core.application.application_abc.ApplicationABC

Parameter:
app: Type[cpl_core.application.application_abc.ApplicationABC]

Application to build

build() ApplicationABC

Creates custom application object

Returns:

Object of cpl_core.application.application_abc.ApplicationABC

async build_async() ApplicationABC

Creates custom application object async

Returns:

Object of cpl_core.application.application_abc.ApplicationABC

use_extension(extension: Type[ApplicationExtensionABC | StartupExtensionABC]) ApplicationBuilder
use_startup(startup: Type[StartupABC]) ApplicationBuilder

Sets the custom startup class to use async

Parameter:
startup: Type[cpl_core.application.startup_abc.StartupABC]

Startup class to use

cpl_core.application.application_builder_abc module

class cpl_core.application.application_builder_abc.ApplicationBuilderABC(*args)

Bases: ABC

ABC for the cpl_core.application.application_builder.ApplicationBuilder

abstract build() ApplicationABC

Creates custom application object

Returns:

Object of cpl_core.application.application_abc.ApplicationABC

abstract async build_async() ApplicationABC

Creates custom application object async

Returns:

Object of cpl_core.application.application_abc.ApplicationABC

abstract async use_startup(startup: Type[StartupABC])

Sets the custom startup class to use async

Parameter:
startup: Type[cpl_core.application.startup_abc.StartupABC]

Startup class to use

cpl_core.application.application_extension_abc module

class cpl_core.application.application_extension_abc.ApplicationExtensionABC

Bases: ABC

abstract async run(config: ConfigurationABC, services: ServiceProviderABC)

cpl_core.application.startup_abc module

class cpl_core.application.startup_abc.StartupABC

Bases: ABC

ABC for the startup class

abstract configure_configuration(config: ConfigurationABC, env: ApplicationEnvironmentABC) ConfigurationABC

Creates configuration of application

Parameter:

config: cpl_core.configuration.configuration_abc.ConfigurationABC env: cpl_core.environment.application_environment_abc

Returns:

Object of cpl_core.configuration.configuration_abc.ConfigurationABC

abstract configure_services(service: ServiceCollectionABC, env: ApplicationEnvironmentABC) ServiceProviderABC

Creates service provider

Parameter:

services: cpl_core.dependency_injection.service_collection_abc env: cpl_core.environment.application_environment_abc

Returns:

Object of cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC

cpl_core.application.startup_extension_abc module

class cpl_core.application.startup_extension_abc.StartupExtensionABC

Bases: ABC

ABC for startup extension classes

abstract configure_configuration(config: ConfigurationABC, env: ApplicationEnvironmentABC)

Creates configuration of application

Parameter:

config: cpl_core.configuration.configuration_abc.ConfigurationABC env: cpl_core.environment.application_environment_abc

abstract configure_services(service: ServiceCollectionABC, env: ApplicationEnvironmentABC)

Creates service provider

Parameter:

services: cpl_core.dependency_injection.service_collection_abc env: cpl_core.environment.application_environment_abc

Module contents

cpl-core CPL core

CPL core package

copyright:
  1. 2020 - 2023 sh-edraft.de

license:

MIT, see LICENSE for more details.

class cpl_core.application.VersionInfo(major, minor, micro)

Bases: tuple

major

Alias for field number 0

micro

Alias for field number 2

minor

Alias for field number 1