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

Function _get_json_sync

api/r2_store.py:62–71  ·  view source on GitHub ↗
(key: str)

Source from the content-addressed store, hash-verified

60
61
62def _get_json_sync(key: str) -> Tuple[Optional[dict], Optional[str]]:
63 try:
64 resp = _get_client().get_object(Bucket=R2_BUCKET, Key=key)
65 except ClientError as e:
66 if e.response["Error"]["Code"] in ("NoSuchKey", "404"):
67 return None, None
68 raise
69 body = resp["Body"].read()
70 etag = resp.get("ETag")
71 return json.loads(body), etag
72
73
74def _put_json_sync(key: str, data: dict, if_match: Optional[str], if_none_match: Optional[str]) -> str:

Callers

nothing calls this directly

Calls 2

_get_clientFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected