base
This commit is contained in:
54
src/discovery/_protocols.py
Normal file
54
src/discovery/_protocols.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""Protocol definitions for the discovery package"""
|
||||
from typing import Iterator, Protocol, Any
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class FileMeta:
|
||||
"""Metadata for a discovered file"""
|
||||
path: Path
|
||||
size: int
|
||||
modified_time: float
|
||||
created_time: float
|
||||
# Add other metadata fields as needed
|
||||
|
||||
|
||||
@dataclass
|
||||
class MountInfo:
|
||||
"""Information about a mounted filesystem"""
|
||||
device: str
|
||||
mount_point: str
|
||||
fs_type: str
|
||||
options: str
|
||||
# Add other mount info fields as needed
|
||||
|
||||
|
||||
@dataclass
|
||||
class DiskInfo:
|
||||
"""Information about a disk/NVMe device"""
|
||||
device: str
|
||||
model: str
|
||||
size: int
|
||||
serial: str
|
||||
# Add other disk info fields as needed
|
||||
|
||||
|
||||
class IFileScanner(Protocol):
|
||||
"""Protocol for file scanning operations"""
|
||||
|
||||
def scan(self, root: Path) -> Iterator[FileMeta]:
|
||||
"""Scan a directory tree and yield file metadata"""
|
||||
...
|
||||
|
||||
|
||||
class ISystemAPI(Protocol):
|
||||
"""Protocol for system information queries"""
|
||||
|
||||
def query_mounts(self) -> list[MountInfo]:
|
||||
"""Query mounted filesystems"""
|
||||
...
|
||||
|
||||
def query_nvmes(self) -> list[DiskInfo]:
|
||||
"""Query NVMe/disk information"""
|
||||
...
|
||||
Reference in New Issue
Block a user