Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/replica/attachment_drivers/memory.ts>AttachmentDriverMemory

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
class AttachmentDriverMemory
import { AttachmentDriverMemory } from "https://deno.land/x/earthstar@v10.0.0-alpha.4/src/replica/attachment_drivers/memory.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)