Skip to content

storage

StorageBackend

Bases: Protocol

Protocol for Operation storage backends (JSON, DynamoDB, SQL, etc).

Source code in wintermute/storage.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class StorageBackend(Protocol):
    """Protocol for Operation storage backends (JSON, DynamoDB, SQL, etc)."""

    def save(self, operation_id: str, data: Dict[str, Any]) -> bool:
        """Save the operation data."""
        ...

    def load(self, operation_id: str) -> Optional[Dict[str, Any]]:
        """Load operation data by ID (or name, depending on backend logic)."""
        ...

    def list_all(self) -> List[str]:
        """Optional: Return list of available operation IDs/Names."""
        ...

    def delete(self, operation_id: str) -> bool:
        """Optional: Delete an operation by ID/Name."""
        ...

delete(operation_id)

Optional: Delete an operation by ID/Name.

Source code in wintermute/storage.py
44
45
46
def delete(self, operation_id: str) -> bool:
    """Optional: Delete an operation by ID/Name."""
    ...

list_all()

Optional: Return list of available operation IDs/Names.

Source code in wintermute/storage.py
40
41
42
def list_all(self) -> List[str]:
    """Optional: Return list of available operation IDs/Names."""
    ...

load(operation_id)

Load operation data by ID (or name, depending on backend logic).

Source code in wintermute/storage.py
36
37
38
def load(self, operation_id: str) -> Optional[Dict[str, Any]]:
    """Load operation data by ID (or name, depending on backend logic)."""
    ...

save(operation_id, data)

Save the operation data.

Source code in wintermute/storage.py
32
33
34
def save(self, operation_id: str, data: Dict[str, Any]) -> bool:
    """Save the operation data."""
    ...