initial
This commit is contained in:
37
app/discovery/_protocols.py
Normal file
37
app/discovery/_protocols.py
Normal file
@@ -0,0 +1,37 @@
|
||||
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]:
|
||||
...
|
||||
Reference in New Issue
Block a user