Various Datastore implementations are available.
An base store is made available to make implementing your own datastore easier.
import { BaseDatastore } from 'datastore-core'class MyDatastore extends BaseDatastore { constructor () { super() } async put (key, val) { // your implementation here } async get (key) { // your implementation here } // etc...} Copy
import { BaseDatastore } from 'datastore-core'class MyDatastore extends BaseDatastore { constructor () { super() } async put (key, val) { // your implementation here } async get (key) { // your implementation here } // etc...}
See the MemoryDatastore for an example of how it is used.
import { Key } from 'interface-datastore'import { MemoryStore, MountStore} from 'datastore-core'const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()}) Copy
import { Key } from 'interface-datastore'import { MemoryStore, MountStore} from 'datastore-core'const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})
A datastore that does not store any data.
import { BlackHoleDatastore } from 'datastore-core'const store = new BlackHoleDatastore() Copy
import { BlackHoleDatastore } from 'datastore-core'const store = new BlackHoleDatastore()
Various Datastore implementations are available.
BaseDatastore
An base store is made available to make implementing your own datastore easier.
Example
See the MemoryDatastore for an example of how it is used.
Wrapping Stores
Example
BlackHoleDatastore
Example
A datastore that does not store any data.