MCPcopy Create free account
hub / github.com/Roy3838/Observer / put_bytes

Function put_bytes

api/r2_store.py:144–154  ·  view source on GitHub ↗

Write raw bytes. Unconditional: callers that use this write to keys nobody else writes, so there is no race to guard against.

(
    key: str,
    body: bytes,
    content_type: str = "application/octet-stream",
    content_encoding: Optional[str] = None,
)

Source from the content-addressed store, hash-verified

142
143
144async def put_bytes(
145 key: str,
146 body: bytes,
147 content_type: str = "application/octet-stream",
148 content_encoding: Optional[str] = None,
149) -> str:
150 """
151 Write raw bytes. Unconditional: callers that use this write to keys nobody
152 else writes, so there is no race to guard against.
153 """
154 return await asyncio.to_thread(_put_bytes_sync, key, body, content_type, content_encoding)
155
156
157async def get_bytes(key: str) -> Optional[Tuple[bytes, str]]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected