angee.storage_integrate.mounts
External mount backend contract and the local-folder implementation.
MountEntry
@dataclass(frozen=True)
class MountEntry()One file exposed by an external mount backend.
MountLocation
@dataclass(frozen=True)
class MountLocation()One navigable node in a mount source tree.
MountBrowseResult
@dataclass(frozen=True)
class MountBrowseResult()One bounded page of locations in a mount source tree.
MountBackend
class MountBackend(BridgeImpl)Descriptor contract for walking and reading an external storage source.
browse
@classmethod
def browse(cls,
*,
credential: Any | None = None,
token: str = "") -> MountBrowseResultList child locations of token before a Mount row exists.
__init__
def __init__(integration: Any) -> NoneBind the Mount row and initialize per-run MIME observations.
check_source
def check_source() -> NoneRaise :class:ValidationError when the configured source is unusable.
iter_entries
def iter_entries() -> Iterator[MountEntry]Yield files in deterministic path order.
iter_directories
def iter_directories() -> Iterator[str]Yield source directories in deterministic order, the tree root excluded.
A file walk yields only files, so a directory with no files under it would never reach the indexer. Mount sync mirrors the full source tree by ensuring a folder for every path this yields, empty directories included. Backends apply the same symlink and traversal safety as :meth:iter_entries; each path is drive-relative in POSIX form.
entry_hash
def entry_hash(entry: MountEntry) -> strStream-hash entry and retain its MIME for the current sync run.
entry_mime
def entry_mime(entry: MountEntry) -> strReturn the MIME captured while hashing entry.
open_entry
def open_entry(entry: MountEntry) -> BinaryIOOpen entry for streaming reads.
storage_backend_spec
def storage_backend_spec() -> tuple[str, dict[str, Any]]Return the storage backend key and config used to serve indexed bytes.
LocalFolderMountBackend
class LocalFolderMountBackend(MountBackend)Walk and read a folder on the Django host without following symlinks.
browse
@classmethod
def browse(cls,
*,
credential: Any | None = None,
token: str = "") -> MountBrowseResultList one bounded level of local directories for mount selection.
__init__
def __init__(integration: Any) -> NoneBind the Mount and reserve its per-instance validated-root cache.
root
@property
def root() -> PathReturn the source root validated for this backend instance.
check_source
def check_source() -> NoneValidate that the configured local folder remains usable.
iter_entries
def iter_entries() -> Iterator[MountEntry]Yield regular files in deterministic POSIX-path order.
iter_directories
def iter_directories() -> Iterator[str]Yield every subdirectory beneath the root, empty ones included.
open_entry
def open_entry(entry: MountEntry) -> BinaryIOOpen a walked file without allowing the relative key to escape root.
storage_backend_spec
def storage_backend_spec() -> tuple[str, dict[str, Any]]Serve indexed bytes through the read-only local-folder backend.
validate_local_folder_root
def validate_local_folder_root(path: str) -> PathReturn a safe, readable absolute local-folder root.
browse_mount_source
def browse_mount_source(backend_class: str,
*,
credential: Any | None = None,
token: str = "") -> MountBrowseResultDispatch pre-connection browsing through the configured Mount backend.