Various Datastore implementations are available.
src/mount
src/keytransform
src/sharding
src/tiered
src/namespace
src/black-hole
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/black-hole'const store = new BlackHoleDatastore() Copy
import { BlackHoleDatastore } from 'datastore-core/black-hole'const store = new BlackHoleDatastore()
Various Datastore implementations are available.
Implementations
src/mount
src/keytransform
src/sharding
src/tiered
src/namespace
src/black-hole
Example: BaseDatastore
An base store is made available to make implementing your own datastore easier:
See the MemoryDatastore for an example of how it is used.
Example: Wrapping Stores
Example: BlackHoleDatastore
A datastore that does not store any data.