make repository type be private (#18304)
Co-authored-by: lizb <lizb@sugon.com>
This commit is contained in:
parent
e90c532c3a
commit
dc9c5a4bc7
1 changed files with 3 additions and 3 deletions
|
|
@ -17,7 +17,7 @@ RepositoryFactoryFunc = Callable[[Mapping[str, Any]], Any]
|
||||||
WorkflowNodeExecutionFactoryFunc = Callable[[Mapping[str, Any]], WorkflowNodeExecutionRepository]
|
WorkflowNodeExecutionFactoryFunc = Callable[[Mapping[str, Any]], WorkflowNodeExecutionRepository]
|
||||||
|
|
||||||
# Repository type literals
|
# Repository type literals
|
||||||
RepositoryType = Literal["workflow_node_execution"]
|
_RepositoryType = Literal["workflow_node_execution"]
|
||||||
|
|
||||||
|
|
||||||
class RepositoryFactory:
|
class RepositoryFactory:
|
||||||
|
|
@ -32,7 +32,7 @@ class RepositoryFactory:
|
||||||
_factory_functions: dict[str, RepositoryFactoryFunc] = {}
|
_factory_functions: dict[str, RepositoryFactoryFunc] = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _register_factory(cls, repository_type: RepositoryType, factory_func: RepositoryFactoryFunc) -> None:
|
def _register_factory(cls, repository_type: _RepositoryType, factory_func: RepositoryFactoryFunc) -> None:
|
||||||
"""
|
"""
|
||||||
Register a factory function for a specific repository type.
|
Register a factory function for a specific repository type.
|
||||||
This is a private method and should not be called directly.
|
This is a private method and should not be called directly.
|
||||||
|
|
@ -44,7 +44,7 @@ class RepositoryFactory:
|
||||||
cls._factory_functions[repository_type] = factory_func
|
cls._factory_functions[repository_type] = factory_func
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _create_repository(cls, repository_type: RepositoryType, params: Optional[Mapping[str, Any]] = None) -> Any:
|
def _create_repository(cls, repository_type: _RepositoryType, params: Optional[Mapping[str, Any]] = None) -> Any:
|
||||||
"""
|
"""
|
||||||
Create a new repository instance with the provided parameters.
|
Create a new repository instance with the provided parameters.
|
||||||
This is a private method and should not be called directly.
|
This is a private method and should not be called directly.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue