class GcsProvider
implements StorageProvider
Since 0.1.0

Google Cloud Storage provider.

Supports native streaming via createReadStream() async-iterated into a web ReadableStream.

Constructors

GcsProvider(
now?: () => number
)
Parameters
optional
options: GcsProviderOptions

GCS connection/injection options

optional
now: () => number

Wall-clock source (epoch ms) for signed-URL expiry. Injected by createProvider as runtime.now() (the only sanctioned clock outside packages/runtime). Defaults to () => 0 for direct construction.

Properties

Since 0.1.0
optional
isHealthy: () => Promise<boolean>

M70c: delegates to the injected client's optional isHealthy?() (the real adapter calls bucket.exists()). Assigned in connect() only when the client provides the member; a client that omits it is unknown, and the indicator reads absence (not false) as that.

Methods

connect(): Promise<void>

Establishes the GCS client — injects the SDK lazily or uses injected client.

delete(path: string): Promise<boolean>

Deletes an object from GCS.

disconnect(): Promise<void>

Disconnect is a no-op for GCS (connectionless HTTP client).

exists(path: string): Promise<boolean>

Reports whether an object exists in GCS.

get(path: string): Promise<Uint8Array | null>

Retrieves an object from GCS; null when absent.

getSignedUrl(
path: string,
options: { expiresIn: number; }
): Promise<string>

Creates a signed GET URL for a GCS object.

getStream(path: string): Promise<ReadableStream<Uint8Array> | null>

Native stream download — adapts GCS createReadStream() (Node Readable) into a web ReadableStream via async iteration (no node: import needed).

isReady(): boolean

Reports readiness.

put(
path: string,
data: Uint8Array,
): Promise<void>

Stores an object in GCS, recording any content type and user metadata on the object itself so a signed URL serves it under the right type.

Usage

import { GcsProvider } from "storage-plugin/src/index.ts";