38 lines
642 B
Python
38 lines
642 B
Python
from typing import Iterator, Protocol, Any
|
|
from pathlib import Path
|
|
from dataclasses import dataclass
|
|
|
|
@dataclass
|
|
class FileMeta:
|
|
path: Path
|
|
size: int
|
|
modified_time: float
|
|
created_time: float
|
|
|
|
@dataclass
|
|
class MountInfo:
|
|
device: str
|
|
mount_point: str
|
|
fs_type: str
|
|
options: str
|
|
|
|
@dataclass
|
|
class DiskInfo:
|
|
device: str
|
|
model: str
|
|
size: int
|
|
serial: str
|
|
|
|
class IFileScanner(Protocol):
|
|
|
|
def scan(self, root: Path) -> Iterator[FileMeta]:
|
|
...
|
|
|
|
class ISystemAPI(Protocol):
|
|
|
|
def query_mounts(self) -> list[MountInfo]:
|
|
...
|
|
|
|
def query_nvmes(self) -> list[DiskInfo]:
|
|
...
|