demessaging.config.backend module
Configuration classes for the de-messaging backend module.
Classes:
|
Configuration base class for functions, modules and classes. |
|
Configuration class for a backend module class. |
|
Configuration class for a backend module function. |
|
A configuration for the listen command |
|
Configuration class for a backend module. |
- class demessaging.config.backend.BaseConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='empty', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}))[source]
Bases:
BaseModelConfiguration base class for functions, modules and classes.
- Parameters:
doc (str) – The documentation of the object. If empty, this will be taken from the corresponding
__doc__attribute.registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.
template (demessaging.template.Template) – The
demessaging.template.Templatethat is used to render this object for the generated API.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods:
render(**context)Generate the code to call this function in the frontend.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- registry: ApiRegistry
- class demessaging.config.backend.ClassConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='class_.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), name: str = '', init_doc: str = '', signature: ~inspect.Signature | None = None, methods: ~typing.List[str] = <factory>, validators: ~typing.Dict[str, ~typing.Any] = <factory>, serializers: ~typing.Dict[str, ~typing.Any] = <factory>, field_params: ~typing.Dict[str, ~typing.Dict[str, ~typing.Any]] = <factory>, annotations: ~typing.Dict[str, ~typing.Any] = <factory>, reporter_args: ~typing.Dict[str, ~deprogressapi.base.BaseReport] = <factory>, json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
BaseConfigConfiguration class for a backend module class.
- Parameters:
doc (str) – The documentation of the object. If empty, this will be taken from the corresponding
__doc__attribute.registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.
template (demessaging.template.Template) – The
demessaging.template.Templatethat is used to render the class for the generated API.name (str) – The name of the function. If empty, this will be taken from the classes
__name__attribute.init_doc (str) – The documentation of the function. If empty, this will be taken from the classes
__init__method.signature (Optional[inspect.Signature]) – The calling signature for the function. If empty, this will be taken from the function itself.
methods (List[str]) – methods to use within the backend modules
validators (Dict[str, Any]) – custom validators for the constructor parameters
serializers (Dict[str, Any]) – A mapping from function argument to serializer that is of instance
pydantic.functional_serializers.PlainSerializerorpydantic.functional_serializers.WrapSerializer.field_params (Dict[str, Dict[str, Any]]) – custom Field overrides for the constructor parameters. See
pydantic.Fields.Field()annotations (Dict[str, Any]) – custom annotations for constructor parameters
reporter_args (Dict[str, deprogressapi.base.BaseReport]) – Arguments that use the dasf-progress-api
json_schema_extra (Dict[str, Any]) – Any extra parameter for the JSON schema export for the function
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- registry: ApiRegistry
- signature: inspect.Signature | None
- class demessaging.config.backend.FunctionConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='function.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), name: str = '', signature: ~inspect.Signature | None = None, validators: ~typing.Dict[str, ~typing.List[~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]]] = <factory>, serializers: ~typing.Dict[str, ~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]] = <factory>, return_validators: ~typing.List[~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)]] | None = None, return_serializer: ~pydantic.types.ImportString | ~typing.Annotated[~typing.Callable, ~pydantic.functional_serializers.PlainSerializer(func=~demessaging.utils.object_to_string, return_type=PydanticUndefined, when_used=always)] | None = None, field_params: ~typing.Dict[str, ~typing.Dict[str, ~typing.Any]] = <factory>, returns: ~typing.Dict[str, ~typing.Any] = <factory>, return_annotation: ~typing.Any | None = None, annotations: ~typing.Dict[str, ~typing.Any] = <factory>, reporter_args: ~typing.Dict[str, ~deprogressapi.base.BaseReport] = <factory>, json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
BaseConfigConfiguration class for a backend module function.
- Parameters:
doc (str) – The documentation of the object. If empty, this will be taken from the corresponding
__doc__attribute.registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.
template (demessaging.template.Template) – The
demessaging.template.Templatethat is used to render the function for the generated API.name (str) – The name of the function. If empty, this will be taken from the functions
__name__attribute.signature (Optional[inspect.Signature]) – The calling signature for the function. If empty, this will be taken from the function itself.
validators (Dict[str, List[Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]]) – Custom validators for function arguments. This parameter is a mapping from function argument name to a list of callables that can be used as validator.
serializers (Dict[str, Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]) – A mapping from function argument to serializing function that is then used for the
pydantic.functional_serializers.PlainSerializer.return_validators (Optional[List[Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')]]]]) – Validators for the return value. This parameter is a list of callables that can be used as validator for the return value.
return_serializer (Union[pydantic.types.ImportString, Annotated[Callable, PlainSerializer(func=<function object_to_string at 0x71be7455feb0>, return_type=PydanticUndefined, when_used='always')], NoneType]) – A function that is used to serialize the return value.
field_params (Dict[str, Dict[str, Any]]) – custom Field overrides for the constructor parameters. See
pydantic.Fields.Field()return_annotation (Optional[Any]) – The annotation for the return value.
annotations (Dict[str, Any]) – custom annotations for function parameters
reporter_args (Dict[str, deprogressapi.base.BaseReport]) – Arguments that use the dasf-progress-api
json_schema_extra (Dict[str, Any]) – Any extra parameter for the JSON schema export for the function
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- registry: ApiRegistry
- return_validators: List[ImportString | Annotated[Callable, PlainSerializer(object_to_string)]] | None
- signature: inspect.Signature | None
- class demessaging.config.backend.ListenConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='empty', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), dump_to: str | None = None, dump_tool: str | None = None, cmd: str | None = None)[source]
Bases:
BaseConfigA configuration for the listen command
- Parameters:
doc (str) – The documentation of the object. If empty, this will be taken from the corresponding
__doc__attribute.registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.
template (demessaging.template.Template) – The
demessaging.template.Templatethat is used to render this object for the generated API.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- registry: ApiRegistry
- class demessaging.config.backend.ModuleConfig(*, doc: str = '', registry: ~demessaging.config.registry.ApiRegistry = <factory>, template: ~demessaging.template.Template = Template(name='module.py', folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/templates'), suffix='.jinja2', context={}), messaging_config: ~demessaging.config.messaging.PulsarConfig | ~demessaging.config.messaging.WebsocketURLConfig, listen_config: ~demessaging.config.backend.ListenConfig = <factory>, log_config: ~demessaging.config.logging.LoggingConfig = LoggingConfig(config_file=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/dasf/checkouts/latest/demessaging/config/logging.yaml'), level=None, logfile=None, config_overrides=None, merge_config=False), debug: bool = False, members: ~typing.List[str | ~typing.Callable | ~typing.Type[object] | ~typing.Any] = <factory>, imports: str = '', json_schema_extra: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
BaseConfigConfiguration class for a backend module.
- Parameters:
doc (str) – The documentation of the object. If empty, this will be taken from the corresponding
__doc__attribute.registry (demessaging.config.registry.ApiRegistry) – Utilities for imports and encoders.
template (demessaging.template.Template) – The
demessaging.template.Templatethat is used to render the module for the generated API.messaging_config (Union[demessaging.config.messaging.PulsarConfig, demessaging.config.messaging.WebsocketURLConfig]) – Configuration on how to connect to the message broker.
listen_config (demessaging.config.backend.ListenConfig) – None
log_config (demessaging.config.logging.LoggingConfig) – Configuration for the logging.
debug (bool) – Run the backend module in debug mode (creates more verbose error messages).
members (List[Union[str, Callable, Type[object], Any]]) – List of members for this module
imports (str) – Imports that should be added to the generate API module.
json_schema_extra (Dict[str, Any]) – Any extra parameter for the JSON schema export for the function
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
DEPRECATED! Get the messaging configuration.
- listen_config: ListenConfig
- log_config: LoggingConfig
- messaging_config: PulsarConfig | WebsocketURLConfig
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property pulsar_config: PulsarConfig | WebsocketURLConfig
DEPRECATED! Get the messaging configuration.
Please use the
messaging_configattribute of this class.
- registry: ApiRegistry