Base Backend#
Base configuration schema for all storage backends in OpenFactory applications.
This module defines the BaseBackendConfig class, which serves as the
foundation for backend-specific configuration schemas (e.g., NFSBackendConfig,
LocalBackendConfig, S3BackendConfig).
Note
Use subclasses to define fields specific to each backend.
The extra=”forbid” option ensures that typos or unexpected fields in configuration files raise validation errors.
Subclasses must implement
BaseBackendConfig.create_backend_instance()to return the actual runtime backend instance.
Warning
The BaseBackendConfig class is an abstract class not intented to be used.
- class openfactory.schemas.filelayer.base_backend.BaseBackendConfig(**data)[source]#
Bases:
BaseModelBase configuration schema for all storage backends in OpenFactory applications.
All backend-specific configuration fields must be defined in a subclass of
BaseBackendConfig(e.g., NFSBackendConfig, S3BackendConfig).Ading a new backend
Create a subclass of
BaseBackendConfigwith its specific fields.Update
openfactory.schemas.filelayer.types.StorageBackendto accept the new backend type.Implement the corresponding
openfactory.filelayer.backend.FileBackendsubclass for deployment and usage.
- create_backend_instance()[source]#
Create a runtime backend instance from this configuration.
Subclasses must implement this method to return the actual backend instance (e.g., NFSBackend).
- Returns:
Any – Runtime backend instance corresponding to this configuration.
- Raises:
NotImplementedError – If the subclass does not implement this method.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].