Setu-TS
    Preparing search index...

    Interface IStorage

    Object storage abstraction.

    const storage = ctx.services.get<IStorage>(CAPABILITIES.STORAGE);
    await storage.put('uploads/photo.jpg', bytes);
    const url = await storage.getSignedUrl('uploads/photo.jpg', { expiresIn: 3600 });

    0.1.0

    interface IStorage {
        delete(path: string): Promise<boolean>;
        exists(path: string): Promise<boolean>;
        get(path: string): Promise<Uint8Array<ArrayBufferLike>>;
        getSignedUrl(path: string, options: SignedUrlOptions): Promise<string>;
        getStream?(
            path: string,
        ): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
        put(
            path: string,
            data: Uint8Array,
            options?: PutObjectOptions,
        ): Promise<void>;
    }

    Implemented by

    Index
    • Retrieves an object.

      Parameters

      • path: string

        Object path/key

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The object bytes

      If the object does not exist

    • Retrieves an object as a streaming body for zero-copy downloads.

      Providers that support native streaming (S3, GCS, Azure) return a live stream; others fall back to buffering the entire object into a one-chunk stream via get.

      When omitted on the provider, the service wraps get in a one-chunk ReadableStream. Absent objects throw (mirroring get).

      Parameters

      • path: string

        Object path/key

      Returns Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

      A ReadableStream of object bytes

      If the object does not exist

      0.2.0