MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / get

Method get

lib/s3-handler.ts:50–59  ·  view source on GitHub ↗
(key: string, path: string)

Source from the content-addressed store, hash-verified

48 }
49
50 async get(key: string, path: string): Promise<GetResult> {
51 try {
52 const result = await this.instance.getObject({Bucket: this.bucket, Key: `${path}/${key}`});
53 if (!result.Body) return {hit: false};
54 return {hit: true, data: Buffer.from(await result.Body.transformToByteArray())};
55 } catch (x: any) {
56 if (x instanceof NoSuchKey) return {hit: false};
57 throw x;
58 }
59 }
60
61 // Unused?
62 async delete(key: string, path: string): Promise<boolean> {

Callers 1

loadFromStorageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected