Skip to content

angee.storage_integrate.mounts

External mount backend contract and the local-folder implementation.

MountEntry

python
@dataclass(frozen=True)
class MountEntry()

One file exposed by an external mount backend.

MountLocation

python
@dataclass(frozen=True)
class MountLocation()

One navigable node in a mount source tree.

MountBrowseResult

python
@dataclass(frozen=True)
class MountBrowseResult()

One bounded page of locations in a mount source tree.

MountBackend

python
class MountBackend(BridgeImpl)

Descriptor contract for walking and reading an external storage source.

browse

python
@classmethod
def browse(cls,
           *,
           credential: Any | None = None,
           token: str = "") -> MountBrowseResult

List child locations of token before a Mount row exists.

__init__

python
def __init__(integration: Any) -> None

Bind the Mount row and initialize per-run MIME observations.

check_source

python
def check_source() -> None

Raise :class:ValidationError when the configured source is unusable.

iter_entries

python
def iter_entries() -> Iterator[MountEntry]

Yield files in deterministic path order.

iter_directories

python
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

python
def entry_hash(entry: MountEntry) -> str

Stream-hash entry and retain its MIME for the current sync run.

entry_mime

python
def entry_mime(entry: MountEntry) -> str

Return the MIME captured while hashing entry.

open_entry

python
def open_entry(entry: MountEntry) -> BinaryIO

Open entry for streaming reads.

storage_backend_spec

python
def storage_backend_spec() -> tuple[str, dict[str, Any]]

Return the storage backend key and config used to serve indexed bytes.

LocalFolderMountBackend

python
class LocalFolderMountBackend(MountBackend)

Walk and read a folder on the Django host without following symlinks.

browse

python
@classmethod
def browse(cls,
           *,
           credential: Any | None = None,
           token: str = "") -> MountBrowseResult

List one bounded level of local directories for mount selection.

__init__

python
def __init__(integration: Any) -> None

Bind the Mount and reserve its per-instance validated-root cache.

root

python
@property
def root() -> Path

Return the source root validated for this backend instance.

check_source

python
def check_source() -> None

Validate that the configured local folder remains usable.

iter_entries

python
def iter_entries() -> Iterator[MountEntry]

Yield regular files in deterministic POSIX-path order.

iter_directories

python
def iter_directories() -> Iterator[str]

Yield every subdirectory beneath the root, empty ones included.

open_entry

python
def open_entry(entry: MountEntry) -> BinaryIO

Open a walked file without allowing the relative key to escape root.

storage_backend_spec

python
def storage_backend_spec() -> tuple[str, dict[str, Any]]

Serve indexed bytes through the read-only local-folder backend.

validate_local_folder_root

python
def validate_local_folder_root(path: str) -> Path

Return a safe, readable absolute local-folder root.

browse_mount_source

python
def browse_mount_source(backend_class: str,
                        *,
                        credential: Any | None = None,
                        token: str = "") -> MountBrowseResult

Dispatch pre-connection browsing through the configured Mount backend.

Released under the AGPL-3.0 License.