A storage adapter represents some way of storing binary data for a Repo

Remarks

StorageAdapters provide a key/value storage interface. The keys are arrays of strings (StorageKey) and the values are binary blobs.

Implements

Constructors

Methods

  • Load the single value corresponding to key

    Parameters

    • keyArray: string[]

    Returns Promise<undefined | Uint8Array>

  • Load all values with keys that start with keyPrefix.

    Parameters

    • keyPrefix: string[]

    Returns Promise<Chunk[]>

    Remarks

    The keyprefix will match any key that starts with the given array. For example:

    • [documentId, "incremental"] will match all incremental saves
    • [documentId] will match all data for a given document.

    Be careful! [documentId] would also match something like [documentId, "syncState"]! We aren't using this yet but keep it in mind.)

  • Save the value data to the key key

    Parameters

    • keyArray: string[]
    • binary: Uint8Array

    Returns Promise<void>

Generated using TypeDoc