vcache.js
function(msg, flags) {
    if (flags.exact) {
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'save' }), save)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'load' }), load)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'list' }), list)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'remove' }), remove)
      return
    }

    var actions = {
      save: save,
      load: load,
      list: list,
      remove: remove
    }

    var core_patterns = [
      { role: 'entity', cmd: 'save' },
      { role: 'entity', cmd: 'load' },
      { role: 'entity', cmd: 'list' },
      { role: 'entity', cmd: 'remove' }
    ]

    _.each(core_patterns, function(core_pat) {
      var pats = seneca.list(core_pat)
      _.each(pats, function(pat) {
        seneca.add(pat, actions[core_pat.cmd])
      })
    })
  }
function(msg, flags) {
    if (flags.exact) {
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'save' }), save)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'load' }), load)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'list' }), list)
      seneca.add(_.extend({}, msg, { role: 'entity', cmd: 'remove' }), remove)
      return
    }

    var actions = {
      save: save,
      load: load,
      list: list,
      remove: remove
    }

    var core_patterns = [
      { role: 'entity', cmd: 'save' },
      { role: 'entity', cmd: 'load' },
      { role: 'entity', cmd: 'list' },
      { role: 'entity', cmd: 'remove' }
    ]

    _.each(core_patterns, function(core_pat) {
      var pats = seneca.list(core_pat)
      _.each(pats, function(pat) {
        seneca.add(pat, actions[core_pat.cmd])
      })
    })
  }
Register cache interface