How to use the loopback-connector.Connector.call function in loopback-connector

To help you get started, we’ve selected a few loopback-connector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger-archives / fabric-sdk-rest / packages / loopback-connector-fabric / lib / fabricconnector.js View on Github external
constructor(settings){
    super();
    //console.log(">> HFCSDKConnector");
    Connector.call(this, 'hfc-sdk', settings);

    this.settings = settings; // Store the settings for ease of access

    Common.validateSettings(this.settings);

    //logger.info("Info output test");
    //logger.debug("Debugging output test");
    //logger.error("Error output test");
  };
github strongloop / loopback-connector-couchdb2 / lib / couchdb.js View on Github external
function CouchDB(name, settings, ds) {
  // Injection for tests
  this.CouchDBDriver = settings.Driver || Driver;
  debug('CouchDB constructor settings: %j', settings);
  Connector.call(this, name, settings);
  this.debug = settings.debug || debug.enabled;
  this.dataSource = ds;

  if (!settings.url && (!settings.username || !settings.password)) {
    throw new Error(g.f('Invalid settings: "url" OR "username"' +
      ' AND "password" required'));
  }
  this.options = _.merge({}, settings);
  // If settings.url is not set, then setup account/password props.
  if (!this.options.url) {
    this.options.account = settings.username;
    this.options.password = settings.password;
  }
  this.pool = {};
};
github guardly / loopback-connector-couchbase / lib / cb.js View on Github external
function CouchbaseDB(settings, dataSource) {

  this.name = 'couchbase';
  this._models = {};
  this.settings = settings;
  this.dataSource = dataSource;
  Connector.call(this, 'couchbase', settings);
}
github strongloop / loopback-datasource-juggler / lib / connectors / kv-memory.js View on Github external
function KeyValueMemoryConnector(settings, dataSource) {
  Connector.call(this, 'kv-memory', settings);

  debug('Connector settings', settings);

  this.dataSource = dataSource;
  this.DataAccessObject = dataSource.juggler.KeyValueAccessObject;

  this._store = Object.create(null);

  this._setupRegularCleanup();
}
util.inherits(KeyValueMemoryConnector, Connector);
github strongloop / loopback-connector-mongodb / lib / mongodb.js View on Github external
function MongoDB(settings, dataSource) {
  Connector.call(this, 'mongodb', settings);

  this.debug = settings.debug || debug.enabled;

  if (this.debug) {
    debug('Settings: %j', settings);
  }

  this.dataSource = dataSource;

  if (
    this.settings.enableOptimisedfindOrCreate === true ||
    this.settings.enableOptimisedFindOrCreate === true ||
    this.settings.enableOptimizedfindOrCreate === true ||
    this.settings.enableOptimizedFindOrCreate === true
  ) {
    MongoDB.prototype.findOrCreate = optimizedFindOrCreate;
github ShoppinPal / Materializecss-Autocomplete / node_modules / loopback-connector-mongodb / lib / mongodb.js View on Github external
function MongoDB(settings, dataSource) {
  Connector.call(this, 'mongodb', settings);

  this.debug = settings.debug || debug.enabled;

  if (this.debug) {
    debug('Settings: %j', settings);
  }

  this.dataSource = dataSource;
  if (this.settings.enableOptimisedfindOrCreate === true ||
    this.settings.enableOptimisedFindOrCreate === true ||
    this.settings.enableOptimizedfindOrCreate === true ||
    this.settings.enableOptimizedFindOrCreate === true) {
    MongoDB.prototype.findOrCreate = optimizedFindOrCreate;
  }
  if (this.settings.enableGeoIndexing === true) {
    MongoDB.prototype.buildNearFilter = buildNearFilter;