Skip to main content
Module

x/earthstar/src/entries/universal.ts>AttachmentDriverMemory

Storage for private, distributed, offline-first applications.
Go to Latest
class AttachmentDriverMemory
Re-export
import { AttachmentDriverMemory } from "https://deno.land/x/earthstar@v10.0.2/src/entries/universal.ts";

An attachment driver which persists attachments in memory. Works everywhere.

Properties

private
attachmentMap: Map<string, Blob>
private
closed: boolean
private
stagingMap: Map<string, Blob>

Methods

private
getKey(formatName: string, attachmentHash: string)
close(erase: boolean)
erase(formatName: string, attachmentHash: string)
filter(hashes: Record<string, Set<string>>): Promise<{ format: string; hash: string; }[]>
getAttachment(formatName: string, attachmentHash: string): Promise<DocAttachment | undefined>
isClosed(): boolean
stage(formatName: string, attachment: ReadableStream<Uint8Array> | Uint8Array)