Hubert - Distributed Infrastructure for Secure Multiparty Transactions - v1.0.0-alpha.20
    Preparing search index...

    Class MemoryKv

    In-memory key-value store for Gordian Envelopes.

    Provides volatile storage with TTL support and automatic cleanup of expired entries.

    Port of struct MemoryKv from server/memory_kv.rs lines 14-21.

    const store = new MemoryKv();
    const arid = ARID.new();
    const envelope = Envelope.new("Hello, Memory!");

    await store.put(arid, envelope, 3600); // 1 hour TTL
    const result = await store.get(arid);

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Store an envelope at the given ARID.

      Port of KvStore::put() implementation from server/memory_kv.rs lines 62-102.

      Parameters

      • arid: ARID
      • envelope: Envelope
      • OptionalttlSeconds: number
      • Optionalverbose: boolean

      Returns Promise<string>

    • Retrieve an envelope for the given ARID.

      Port of KvStore::get() implementation from server/memory_kv.rs lines 104-181.

      Parameters

      • arid: ARID
      • OptionaltimeoutSeconds: number
      • Optionalverbose: boolean

      Returns Promise<Envelope | null>

    • Check if an envelope exists at the given ARID.

      Port of KvStore::exists() implementation from server/memory_kv.rs lines 183-186.

      Parameters

      • arid: ARID

      Returns Promise<boolean>