import { Store } from "https://deno.land/x/willow@0.2.1/src/store/store.ts";
A local set of a particular namespace's authorised entries to be written to, read from, and synced with other Store
s. Applies the concepts of the Willow Data Model to the set of entries stored inside.
Keeps all data in memory unless persisted entry / payload drivers are specified.
https://willowprotocol.org/specs/data-model/index.html#store
Constructors
Properties
Methods
Retrieve a AuthorisationToken
for a given entry, if held in storage.
Retrieve a Payload
for a given entry, if held in storage.
Attempt to store an authorised entry in the Store
.
An entry will not be ingested if it is unauthorised; if a newer entry with the same path and subspace are present; or if a newer entry with a path that is a prefix of the given entry exists. See the Willow Data Model's Concepts for more information.
Additionally, if the entry's path is a prefix of already-held older entries, those entries will be removed from the Store
. See prefix pruning for more information.
Attempt to store the corresponding payload for one of the store's entries.
A payload will not be ingested if the given entry is not stored in the store; if the hash of the payload does not match the entry's; or if it is already held.
Return an array of Entry
which would be pruned by a given Entry
were it to be ingested. Can be used to prevent potentially undesirable destructive operations.
Retrieve an asynchronous iterator of entry-payload-authorisation triples from the store for a given AreaOfInterest
.
Retrieve an asynchronous iterator of entry-payload-authorisation triples from the store for a given Range
.
Always returns entries in chronological order.
Create a new authorised entry for a given payload, and store both in the store. An entry will not be ingested if it is unauthorised; if a newer entry with the same path and subspace are present; or if a newer entry with a path that is a prefix of the given entry exists. See the Willow Data Model's Concepts for more information.
Additionally, if the new entry's path is a prefix of already-held older entries, those entries will be removed from the Store
. See prefix pruning for more information.
Summarise a given Range
into a PreFingerprint
mapping to the set of entries included by that range.
This is mostly used during sync for 3d range-based set reconciliation.