@wholebuzz/archive
v0.0.2
Published
Archive database using sorted chains of JSON array blocks
Downloads
1
Readme
@wholebuzz/archive
Archive database using sorted chains of JSON array blocks. Each block is represented as a file (with random filename) on Cloud Storage and structured as an ArchiveBlock JSON object. Uses @wholebuzz/fs
for atomic appends to Cloud Storage.
Example
const archive = new ArchiveDatabaseServer<Event>(
'news',
[
{
name: 'publisher',
getter: getEventPublishers,
sorter: compareEventReverse,
blockDatabase: new FileStorageArchiveBlockDatabase<Event>(
fileSystem,
'gs://archive',
parseEventJSON
),
tipDatabase: new FileStorageArchiveTipDatabase(
fileSystem,
'gs://archive-index',
sha1),
},
])
await archive.addItems(item);
const tipBlock = await archive.getTipBlock(archive.indices[0], publisher)
Table of contents
Classes
- ArchiveBlockDatabase
- ArchiveBlockDatabaseServer
- ArchiveDatabase
- ArchiveDatabaseServer
- ArchiveTipDatabase
- ArchiveTipDatabaseServer
- FileStorageArchiveBlockDatabase
- FileStorageArchiveTipDatabase
Interfaces
- AddItemResult
- ArchiveBlock
- ArchiveBlockHeader
- ArchiveBlockOfType
- ArchiveDatabaseOptions
- ArchiveDatabaseServerInsert
- ArchiveDatabaseServerOptions
- ArchiveGetBlockOptions
- ArchiveGetTipOptions
- ArchiveIndex
- ArchiveIndexBlockOfType
- ArchiveServerIndex
- ArchiveTipRecord
Variables
Variables
sorted
• Const
sorted: any
Defined in: node_modules/@wholebuzz/archive-base/lib/index.d.ts:1