Files
defrag/app/migration/_protocols.py
2025-12-13 12:00:34 +01:00

29 lines
750 B
Python

from typing import Protocol
from pathlib import Path
from ..shared.models import OperationRecord
class IMigrationStrategy(Protocol):
def migrate(self, source: Path, destination: Path, verify: bool=True) -> bool:
...
def can_migrate(self, source: Path, destination: Path) -> bool:
...
def estimate_time(self, source: Path) -> float:
...
def cleanup(self, source: Path) -> bool:
...
class IMigrationEngine(Protocol):
def plan_migration(self, disk: str, target_base: Path) -> list[OperationRecord]:
...
def execute_migration(self, operations: list[OperationRecord], dry_run: bool=False) -> dict:
...
def rollback(self, operation: OperationRecord) -> bool:
...