Interfacetypesv0.17.0
KvDriver
The backend behind config.kv. A driver only stores and returns strings because seedcord turns
every value into JSON before it calls the driver. Each method may return its result directly or as
a promise.
config.kv also requires Disposable or AsyncDisposable on the driver. A node bot calls it
after the last shutdown phase to close the backend.
interface KvDriverclass SqliteDriver implements KvDriver, Disposable { ... }
class RedisDriver implements KvDriver, AsyncDisposable { ... }delete(key: string): Promisable<void>entries(
prefix: string
): AsyncIterable<KvEntry> | Iterable<KvEntry>get(
key: string
): Promisable<string | undefined>set(
key: string,
value: string,
ttlMs?: number
): Promisable<void>Parameter:
ttlMsThe backend may delete the key after this many milliseconds. Seedcord checks the expiry on read either way.