Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Simplifies the config.yaml and node configuration #36

Merged
merged 4 commits into from
Dec 31, 2014
Merged

Conversation

nstott
Copy link
Contributor

@nstott nstott commented Dec 31, 2014

makes the nodes config be derived by merging what's in the config.yaml and what is specified in the application.js. the config.yaml node is a map[string]map[string]bool rather then being strictly typed with Type and URI. it's possible to run without a config.yaml entirely.

for example, it's possible to do the following:

with a config.yaml containing:

nodes:
  localmongo:
    type: mongo
    uri: mongodb://localhost/boom
    namespace: boom.foo
    debug: true
  stdout:
    type: file
    uri: stdout://

and run transporter like this:
transporter eval --config test/config.yaml 'Source({name:"localmongo"}).transform({filename:"test/transformers/passthrough_and_log.js"}).save({name:"stdout"})'

as well, you can run with no config by running transporter with:
transporter eval 'Source({name:"localmongo", type: "mongo", uri:"mongodb://localhost/boom", namespace:"boom.foo", tail:true}).transform({filename:"test/transformers/passthrough_and_log.js"}).save({name:"loosefile", type:"file", uri:"file:///tmp/foo"})'

fixes #12

…l, and what is specified in the application.js. the config.yaml node is a map[string]map[string]bool rather then being strictly typed with Type and URI. it's possible to run without a config.yaml entirely. fixes #12
…des to be configured with just a string instead of a json hash.
@@ -5,7 +5,7 @@ import (
"path/filepath"
"time"

"github.com/compose/transporter/pkg/adaptor"
// "github.com/compose/transporter/pkg/adaptor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to leave the import commented out? vs. just removing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, sloppy

} else { // we don't have a name, so lets generate one.
u, err := uuid.NewV4()
if err != nil {
return n, fmt.Errorf("transform error. uuid error (%s)", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a "transform error"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

nstott added a commit that referenced this pull request Dec 31, 2014
Simplifies the config.yaml and node configuration
@nstott nstott merged commit 7471d2a into master Dec 31, 2014
@nstott nstott deleted the 12-config branch December 31, 2014 19:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration is confusing and incomplete
2 participants