hyperion.ports.storage¶
hyperion.ports.storage
¶
Port: object storage abstraction.
StoragePort is the dependency-inversion seam between :class:Catalog-style
callers and a concrete object store (S3, local filesystem, in-memory). It is a
runtime_checkable :class:typing.Protocol -- adapters satisfy it
structurally, no forced inheritance (see docs/ddd-refactor-plan.md F1 /
Step 4).
Contract:
get/open/get_attributesraise :class:ObjectNotFoundErrorwhen the key is absent.deleteis idempotent -- deleting a missing key is a no-op, never an error.iter_keysyields keys in the same namespaceputaccepts (adapters that add a storage-side prefix strip it back off).
ObjectNotFoundError
¶
Bases: KeyError
Raised when a requested storage key does not exist.
Subclasses :class:KeyError so callers that already except KeyError
(and the in-memory adapter's natural error) keep working.
ObjectAttributes
dataclass
¶
Backend-agnostic metadata for a stored object.
StoragePort
¶
Bases: Protocol
Abstraction over object storage backends.
put
¶
put_async
async
¶
get
¶
Return the full object stored under key.
Raises:
| Type | Description |
|---|---|
ObjectNotFoundError
|
if |
open
¶
Open key for streaming binary reads.
Raises:
| Type | Description |
|---|---|
ObjectNotFoundError
|
if |
iter_keys
¶
exists
¶
delete
¶
get_attributes
¶
Return :class:ObjectAttributes for key.
Raises:
| Type | Description |
|---|---|
ObjectNotFoundError
|
if |