class GcsAdapter
implements PresignableAdapter

Adapter for Google Cloud Storage.

Constructors

new
GcsAdapter(
client: GcsClient,
bucketName: string,
prefix: string,
)

Methods

close(): Promise<void>
delete(key: string): Promise<void>

Deletes an object from GCS. This operation is idempotent; it returns successfully even if the object does not exist.

get(key: string): Promise<StorageObject>
head(key: string): Promise<StorageMetadata>
private
isNotFound(error: unknown): boolean
list(prefix?: string): AsyncIterable<StorageEntry>
private
mapMetadata(metadata?: Record<string,
string
| number
| boolean
| null
>
): Record<string, string> | undefined
presign(
key: string,
options: PresignOptions,
): Promise<string>
put(
key: string,
body: BodyInput,
options?: PutOptions,
): Promise<void>

Usage

import { GcsAdapter } from ".";