datastore-core
0.6.0

Intro

Installable via npm install --save datastore-core, it can also be used directly in the browser.

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

$ npm install --save datastore-core

You can then require() datastore-core as normal:

const datastoreCore = require('datastore-core')

In the Browser

Datastore-core should work in any ES2015 environment out of the box.

Usage:

<script type="text/javascript" src="index.js"></script>

The portable versions of datastore-core, including index.js and index.min.js, are included in the /dist folder. Datastore-core can also be found on unpkg.com under

KeyTransformDatastore

An object with a pair of functions for (invertibly) transforming keys

Parameters

  1. child: any:  
  2. transform: any:  

KeyTransformDatastore

Map one key onto another key.

Parameters

  1. child: any:  
  2. transform: any:  

KeyTransformDatastore

A datastore shim, that wraps around a given datastore, changing the way keys look to the user, for example namespacing keys, reversing them, etc.

Parameters

  1. child: any:  
  2. transform: any:  

MountDatastore

A datastore that can combine multiple stores inside various key prefixs.

Parameters

  1. mounts: any:  

NamespaceDatastore

Wraps a given datastore into a keytransform which makes a given prefix transparent.

For example, if the prefix is new Key(/hello) a call to store.put(new Key('/world'), mydata) would store the data under /hello/world.

Extends /* ::import type {Callback, Datastore, Query, QueryResult} from 'interface-datastore'*/ /*** Wraps a given datastore into a keytransform which* makes a given prefix transparent.** For example, if the prefix is `new Key(/hello)` a call* to `store.put(new Key('/world'), mydata)` would store the data under* `/hello/world`.**/ /* :: <Value> */KeytransformDatastore /* :: <Value> */.

Parameters

  1. child: any:  
  2. prefix: any:  

parseShardFun

Convert a given string to the matching sharding function.

Parameters

  1. str: string:  

Returns

ShardV1

ShardingDatastore

Backend independent abstraction of go-ds-flatfs.

Wraps another datastore such that all values are stored sharded according to the given sharding function.

Parameters

  1. store: any:  
  2. shard: any:  

TieredDatastore

A datastore that can combine multiple stores. Puts and deletes will write through to all datastores. Has and get will try each store sequentially. Query will always try the last one first.

Parameters

  1. stores: any: