feat: ship end-to-end interior design MVP
This commit is contained in:
@@ -87,6 +87,18 @@ class S3Storage:
|
||||
)
|
||||
return response["Body"].read(), response.get("ContentType", "application/octet-stream")
|
||||
|
||||
def put_render(self, object_key: str, content: bytes, content_type: str) -> None:
|
||||
self._put(self._value("s3_bucket_renders"), object_key, content, content_type)
|
||||
|
||||
def get_render(self, object_key: str) -> tuple[bytes, str]:
|
||||
if not self.configured:
|
||||
raise RuntimeError("MinIO/S3 is not configured.")
|
||||
response = self._client().get_object(
|
||||
Bucket=self._value("s3_bucket_renders"),
|
||||
Key=object_key,
|
||||
)
|
||||
return response["Body"].read(), response.get("ContentType", "application/octet-stream")
|
||||
|
||||
def _put(self, bucket: str, object_key: str, content: bytes, content_type: str) -> None:
|
||||
if not self.configured:
|
||||
raise RuntimeError("MinIO/S3 is not configured.")
|
||||
|
||||
Reference in New Issue
Block a user