MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / get_file_url

Method get_file_url

core/storage.py:384–399  ·  view source on GitHub ↗
(self, file_code: FileCodes)

Source from the content-addressed store, hash-verified

382 raise HTTPException(status_code=503, detail="服务代理下载异常,请稍后再试")
383
384 async def get_file_url(self, file_code: FileCodes):
385 if file_code.prefix == "文本分享":
386 return file_code.text
387 if self.proxy:
388 return await get_file_url(file_code.code)
389 else:
390 async with self._client() as s3:
391 result = await s3.generate_presigned_url(
392 "get_object",
393 Params={
394 "Bucket": self.bucket_name,
395 "Key": await file_code.get_file_path(),
396 },
397 ExpiresIn=3600,
398 )
399 return result
400
401 async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
402 """

Callers 1

build_select_detailFunction · 0.45

Calls 3

_clientMethod · 0.95
get_file_urlFunction · 0.90
get_file_pathMethod · 0.80

Tested by

no test coverage detected