Interface RoKV

interface RoKV {
    get(k: string, opts?: {
        revision: number;
    }): Promise<KvEntry>;
    history(opts?: {
        key?: string | string[];
    }): Promise<QueuedIterator<KvWatchEntry>>;
    keys(filter?: string | string[]): Promise<QueuedIterator<string>>;
    status(): Promise<KvStatus>;
    watch(opts?: KvWatchOptions): Promise<QueuedIterator<KvWatchEntry>>;
}

Hierarchy (view full)

Methods

  • Returns the KvEntry stored under the key if it exists or null if not. Note that the entry returned could be marked with a "DEL" or "PURGE" operation which signifies the server stored the value, but it is now deleted.

    Parameters

    • k: string
    • Optionalopts: {
          revision: number;
      }
      • revision: number

    Returns Promise<KvEntry>

  • Returns an iterator of the specified key's history (or all keys). Note you can specify multiple keys if running on server 2.10.x or better.

    Parameters

    • Optionalopts: {
          key?: string | string[];
      }
      • Optionalkey?: string | string[]

    Returns Promise<QueuedIterator<KvWatchEntry>>

  • Returns an iterator of all the keys optionally matching the specified filter.

    Parameters

    • Optionalfilter: string | string[]

      default is all keys

    Returns Promise<QueuedIterator<string>>

  • Returns information about the Kv

    Returns Promise<KvStatus>

  • Returns an iterator that will yield KvEntry updates as they happen.

    Parameters

    Returns Promise<QueuedIterator<KvWatchEntry>>