exports = module.exports = function(keyring) {
  var redis = require('redis');
  
  
  var api = {};
  
  api.createConnection = function(options, connectListener) {
    var client = redis.createClient(options.port, options.address || options.name);
    if (connectListener) { client.once('connect', connectListener); }
    
    // TODO: Handle initial errors somehow...
    
    // FIXME: put this back
    /*
    keyring.get(options.name, function(err, cred) {
      // TODO: Error handling
      client.auth(cred.password);
    });
    */
    
    return client;
  };
  
  return api;
};

exports['@singleton'] = true;
exports['@implements'] = 'http://i.bixbyjs.org/redis';
exports['@require'] = [
  'http://i.bixbyjs.org/security/Keyring'
];

@@ -1,16 +1,466 @@
+/**%0A * Redis.%0A *%0A * This component provides an API for querying %5BRedis%5D%5B1%5D, a data structure%0A * store used as a database, cache, and message broker.%0A *%0A * Internally, the implementation uses the %5B%60redis%60%5D%5B2%5D module.  The intent of%0A * this API is to provide a wrapper that conforms more closely to Node.js'%0A * %5B%60'net%60%5D%5B3%5D module.%0A *%0A * %5B1%5D: https://redis.io/%0A * %5B2%5D: https://github.com/NodeRedis/node-redis%0A * %5B3%5D: https://nodejs.org/api/net.html%0A */%0A
 exports = module
@@ -534,19 +534,19 @@
  %0A  var 
-api
+API
  = %7B%7D;%0A 
@@ -549,19 +549,35 @@
 %7D;%0A  %0A  
-api
+API.connect =%0A  API
 .createC
@@ -1042,19 +1042,19 @@
  return 
-api
+API
 ;%0A%7D;%0A%0Aex

Add comments.