Skip to content

xo transform #5

@coryodaniel

Description

@coryodaniel

Add a command xo transform to transform input values between different different forms.

Embedded v8 engines:

We should wait until we have the UI together to get an idea of what the inputs/API might look like, but an example would be:

xo start-deployment > deployment.json
xo transform \
 --deployment=deployment.json \
 --dest-schema=schema-params

NOTE: the deployment being returned from startDeployment will have the schemaName as a field alongside the params field.
xo transform will take end-user params and the name of the schema the user submitted and run a mapper.js file in the embedded v8 engine to convert to the proper params for --dest-schema.

An example:

Using a guided config, we might ask about write throughput rather than RAM size for redis... but our main schema (schema-params.json) takes a "memory" parameter.

params-data.json

{
  "records_per_second": 100,
  "average_record_size_in_kb": 1024
}

`some-neophyte-schema.json`

```json
{
  "properties": {
    "records_per_second": {"type": "integer"},
    "average_record_size_in_kb": {"type": "integer"},
  }
}

schema-params.json

{
  "properties": {
    "memory": {"type": "integer"}
  }
}

A mapper.js file will be written by a bundle author:

mapper.js

// some boilerplate
export default function(data, src, dest) {
 // razzle dazzle magic 
  return records_per_second * average_record_size_in_kb
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions