Interface for all object store clients.

interface ObjectStoreClient {
    deleteObject: ((key, bucket) => Promise<void>);
    getObject: ((key, bucket) => Promise<null | StoreObject>);
    listObjectKeys: ((prefix, bucket) => AsyncIterable<string>);
    putObject: ((object, key, bucket) => Promise<void>);
}

Properties

deleteObject: ((key, bucket) => Promise<void>)

Delete the object corresponding to key.

This method resolves even if the key doesn't exist, in order to provide a normalised API, since Amazon S3 always returns a 204 regardless of whether the object exists (GCS returns a 404 and its SDK throws an error).

Type declaration

    • (key, bucket): Promise<void>
    • Delete the object corresponding to key.

      This method resolves even if the key doesn't exist, in order to provide a normalised API, since Amazon S3 always returns a 204 regardless of whether the object exists (GCS returns a 404 and its SDK throws an error).

      Parameters

      • key: string
      • bucket: string

      Returns Promise<void>

getObject: ((key, bucket) => Promise<null | StoreObject>)

Retrieve the object by key or return null if the key doesn't exist.

Type declaration

    • (key, bucket): Promise<null | StoreObject>
    • Retrieve the object by key or return null if the key doesn't exist.

      Parameters

      • key: string
      • bucket: string

      Returns Promise<null | StoreObject>

listObjectKeys: ((prefix, bucket) => AsyncIterable<string>)

Retrieve the keys for all the objects in the specified bucket with the specified key prefix.

This will handle pagination if the backend supports it (S3 does, Minio doesn't).

Type declaration

    • (prefix, bucket): AsyncIterable<string>
    • Retrieve the keys for all the objects in the specified bucket with the specified key prefix.

      This will handle pagination if the backend supports it (S3 does, Minio doesn't).

      Parameters

      • prefix: string
      • bucket: string

      Returns AsyncIterable<string>

Param: prefix

Param: bucket

putObject: ((object, key, bucket) => Promise<void>)

Type declaration

    • (object, key, bucket): Promise<void>
    • Parameters

      Returns Promise<void>

Generated using TypeDoc