Home Reference Source Repository
import Distributor from 'schema-mapper-store/lib/distributor.js'
public class | source

Distributor

Client for communicating with the stores in a direct manner (no network, pure JS)

Constructor Summary

Public Constructor
public

constructor(storageDrivers: Array)

Create a new Distributor instance

Member Summary

Public Members
public

An array of storage drivers

Method Summary

Public Methods
public

delItem(schema: Schema, delItemInfo: DelItemInfo): Promise

Distribute a delItem command to all storage drivers

public

drop(projectName: String, projectVersion: Number): Promise

Distribute a drop command to all storage drivers

public

migrate(projectId: String, oldProject: Project, project: Project, changes: Changes): Promise

Distribute a migrate command to all storage drivers

public

putItem(schema: Schema, dataInfo: DataInfo): Promise

Distribute a putItem command to all storage drivers

Public Constructors

public constructor(storageDrivers: Array) source

Create a new Distributor instance

Params:

NameTypeAttributeDescription
storageDrivers Array

An array of storage drivers

Public Members

public storageDrivers: Array source

An array of storage drivers

Public Methods

public delItem(schema: Schema, delItemInfo: DelItemInfo): Promise source

Distribute a delItem command to all storage drivers

Params:

NameTypeAttributeDescription
schema Schema

Information about the schema associated with the item

delItemInfo DelItemInfo

Information about the item to remove

Return:

Promise

public drop(projectName: String, projectVersion: Number): Promise source

Distribute a drop command to all storage drivers

Params:

NameTypeAttributeDescription
projectName String

Project name to drop

projectVersion Number

Project version to drop

Return:

Promise

public migrate(projectId: String, oldProject: Project, project: Project, changes: Changes): Promise source

Distribute a migrate command to all storage drivers

Params:

NameTypeAttributeDescription
projectId String

Project id

oldProject Project

Current project

project Project

Project to migrate to

changes Changes

Changes to get to the new project (extend's being resolved)

Return:

Promise

public putItem(schema: Schema, dataInfo: DataInfo): Promise source

Distribute a putItem command to all storage drivers

Params:

NameTypeAttributeDescription
schema Schema

A schema

dataInfo DataInfo

A dataInfo object

Return:

Promise