Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created August 26, 2011 20:55
Show Gist options
  • Save Raynos/1174421 to your computer and use it in GitHub Desktop.
Save Raynos/1174421 to your computer and use it in GitHub Desktop.
MessageModel = {
"get": function (messageId, cb) {
cb(err, messageObject)
}
"update": function(messageId, obj, cb) {
cb(err, messageObject)
}
"getStars": function(count, from, to, cb) {
cb(err, arrayOfStarredMessages)
}
"create": function(obj, cb) {
cb(err, messageObject)
}
"getMessages": function(count, from, to, cb) {
cb(err, arrayOfMessages)
}
};
RoomModel = {
"getAll": function (cb) {
cb(err, arrayOfRooms)
}
"get": function (roomId, cb) {
cb(err, roomObject)
}
"update": function (roomId, obj, cb) {
cb(err, roomObject)
}
"create": function(obj, cb) {
cb(err, roomObject);
}
"addUser": function(userId, cb) {
cb(err, userObject)
}
"removeUser": function(userId, cb) {
cb(err, userObject)
}
"usersInRoom": function(cb) {
cb(err, arrayOfUsersInRoom)
}
};
UserModel = {
"getAll": function (cb) {
cb(err, arrayOfUsers)
}
"get": function (userId, cb) {
cb(err, userObject)
}
"update": function(userId, obj, cb) {
cb(err, userObject)
}
"create": function(obj, cb) {
cb(err, userObject)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment