Skip to main content
Module

x/earthstar/mod.ts>ReplicaDriverMemory

A specification and Javascript library for building online tools you can truly call your own.
Go to Latest
class ReplicaDriverMemory
implements IReplicaDriver
import { ReplicaDriverMemory } from "https://deno.land/x/earthstar@v9.3.3/mod.ts";

An in-memory replica driver. Its contents will be lost when it is closed. Works everywhere.

Constructors

new
ReplicaDriverMemory(share: ShareAddress)

Properties

_configKv: Record<string, string>
_isClosed: boolean
_maxLocalIndex: LocalIndex
docByPathAndAuthor: Map<string, Doc>
docsByPathNewestFirst: Map<Path, Doc[]>

Methods

_getAllDocs(): Promise<Doc[]>
_getLatestDocs(): Promise<Doc[]>
close(erase: boolean)
deleteConfig(key: string): Promise<boolean>
getConfig(key: string): Promise<string | undefined>
isClosed(): boolean
listConfigKeys(): Promise<string[]>
queryDocs(queryToClean: Query): Promise<Doc[]>
setConfig(key: string, value: string): Promise<void>
upsert(doc: Doc): Promise<Doc>