Coverage for src / ezqt_app / domain / ports / config_service.py: 100.00%
3 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-26 07:07 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-26 07:07 +0000
1# ///////////////////////////////////////////////////////////////
2# DOMAIN.PORTS.CONFIG_SERVICE - Config service port
3# Project: ezqt_app
4# ///////////////////////////////////////////////////////////////
6"""Protocol definitions for configuration services."""
8from __future__ import annotations
10# ///////////////////////////////////////////////////////////////
11# IMPORTS
12# ///////////////////////////////////////////////////////////////
13# Standard library imports
14from pathlib import Path
15from typing import Any, Protocol
18# ///////////////////////////////////////////////////////////////
19# PROTOCOLS
20# ///////////////////////////////////////////////////////////////
21class ConfigServiceProtocol(Protocol):
22 """Technical contract for configuration services."""
24 def set_project_root(self, project_root: Path | str) -> None:
25 """Set the active project root directory."""
27 def load_config(
28 self, config_name: str, force_reload: bool = False
29 ) -> dict[str, Any]:
30 """Load a named configuration."""
32 def get_config_value(
33 self, config_name: str, key_path: str, default: Any = None
34 ) -> Any:
35 """Read a specific value from a configuration."""
37 def save_config(self, config_name: str, config_data: dict[str, Any]) -> bool:
38 """Persist a named configuration."""