Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zetta package exposes device registry and peer registry files #132

Merged
merged 1 commit into from
Jan 30, 2015

Conversation

AdamMagaluk
Copy link
Collaborator

This helps with allowing to create things like we do in test/fixture/mem_registry.js when running outside the zetta repo.

ex:

var util = require('util');
var levelup = require('levelup');
var memdown = require('memdown');
var DeviceRegistry = require('../../lib/device_registry');

var MemRegistry = module.exports = function() {
  var db = levelup({ db: memdown });
  DeviceRegistry.call(this, { db: db, collection: 'devices' });
}
util.inherits(MemRegistry, DeviceRegistry);

@mdobson
Copy link
Contributor

mdobson commented Jan 29, 2015

Signed Off. We'll need to add docs for inheriting from registries.

Registry takes and options object with three potential combos for things.

  1. db a levelup instance. Replaces medea. (optional)
  2. path a valid path to place a medea database. If db isn't supplied then you need to provide this.
    • defaults to .peers/ for peer registry and .devices/ for the device registry.
  3. collection a collection name for calypso. There is a better way to do this, but for now it is needed.

AdamMagaluk added a commit that referenced this pull request Jan 30, 2015
zetta package exposes device registry and peer registry files
@AdamMagaluk AdamMagaluk merged commit 6a99566 into master Jan 30, 2015
@AdamMagaluk AdamMagaluk deleted the expose-registries branch January 30, 2015 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants