Interface DidResolverCache

Interface for cache implementations used by to store resolved DID documents.

interface DidResolverCache {
    clear(): Promise<void>;
    close(): Promise<void>;
    delete(key): Promise<boolean | void>;
    get(key): Promise<undefined | void | DidResolutionResult>;
    set(key, value): Promise<void>;
}

Hierarchy

Implemented by

Methods

  • Clears the store, removing all key-value pairs.

    Returns Promise<void>

    A promise that resolves when the store has been cleared.

  • Closes the store, freeing up any resources used. After calling this method, no other operations can be performed on the store.

    Returns Promise<void>

    A promise that resolves when the store has been closed.

  • Deletes a key-value pair from the store.

    Parameters

    • key: string

      The key of the value to delete.

    Returns Promise<boolean | void>

    A promise that resolves to true if the element existed and has been removed, or false if the element does not exist.

  • Fetches a value from the store given its key.

    Parameters

    • key: string

      The key of the value to retrieve.

    Returns Promise<undefined | void | DidResolutionResult>

    A promise that resolves with the value associated with the key, or undefined if no value exists for that key.

  • Sets the value for a key in the store.

    Parameters

    • key: string

      The key under which to store the value.

    • value: void | DidResolutionResult

      The value to be stored.

    Returns Promise<void>

    A promise that resolves when the value has been set.