Skip to content

Instantly share code, notes, and snippets.

@jimmyjacobson
Created February 27, 2012 07:08
Show Gist options
  • Save jimmyjacobson/1922111 to your computer and use it in GitHub Desktop.
Save jimmyjacobson/1922111 to your computer and use it in GitHub Desktop.
keys.js
//Prefix
var prefix = exports.prefix = 'cinchtool';
//link Keys
exports.link = 'link';
exports.links = 'links';
exports.linksId = prefix + ':ids:link';
exports.linkKey = function(id) {
return prefix + ':link:' + id;
}
exports.linksKey = prefix + ':links';
exports.linkIdToKey = function(id) {
return prefix + ':link:' + id + ':key';
}
exports.linkClickCounter = function(id) {
return prefix + ':link:' + id + ':clicks';
}
exports.linkCinchClickCounter = function(id) {
return prefix + ':link:' + id + ':clicks:mobile';
}
exports.linkStats = function(id) {
return prefix + ':link:' + id + ':stats';
}
//Customer Keys
exports.customerIds = prefix + ':ids:customer';
exports.customerKey = function(id) {
return prefix + ':customer:' + id;
}
exports.customersKey = prefix + ':customers';
exports.customerFoxyKey = function(foxyId) {
return prefix + ':customer:foxy:' + foxyId;
}
exports.customerByEmail = function(email) {
return prefix + ':customer:email:' + email;
}
exports.customerLinks = function(id) {
return prefix + ':customer:' + id + ':links';
}
//Embedly Keys
exports.embedlyCache = function(hash) {
return prefix + ':embedly:' + hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment