123456789101112131415161718192021222324 |
- {
- "name": "pomelo-status-plugin",
- "version": "0.0.6",
- "private": false,
- "author": {
- "name": "py8765 pengyang633@126.com/@py8765"
- },
- "contributors": [
- {
- "name": "gitig"
- }
- ],
- "dependencies": {
- "redis": "2.6.0-2",
- "pomelo-logger": "0.1.2"
- },
- "readme": "pomelo-status-plugin\r\n====================\r\n\r\npomelo-status-plugin is a plugin for pomelo, it can be used in pomelo(>=0.6).\r\n\r\npomelo-status-plugin provides global status service for pomelo, which uses persistent storage to save users information.\r\n\r\n##Installation\r\n\r\n```\r\nnpm install pomelo-status-plugin\r\n```\r\n\r\n##Usage\r\n\r\n```\r\nvar status = require('pomelo-status-plugin');\r\n\r\napp.use(status, {status: {\r\n host: '127.0.0.1',\r\n port: 6379\r\n}});\r\n\r\n```\r\n\r\n##API\r\n\r\n###getSidsByUid(uid, cb)\r\nget frontend server id by user id\r\n####Arguments\r\n+ uid - user id\r\n+ cb - callback function\r\n\r\n####Return\r\n+ err - error\r\n+ list - array of frontend server ids\r\n\r\n###getStatusByUid(uid, cb)\r\n####Arguments\r\n+ uid - user id\r\n+ cb - callback function\r\n\r\n####Return\r\n+ err - error\r\n+ status - boolean, true if user is online (at least one session with a frontend) or false otherwise\r\n\r\n###getStatusByUids(uids, cb)\r\n####Arguments\r\n+ uids - array of user ids\r\n+ cb - callback function\r\n\r\n####Return\r\n+ err - error\r\n+ statuses - object with uid as keys and boolean as value, true if user is online (at least one session with a frontend) or false otherwise\r\n\r\n###pushByUids(uids, route, msg, cb)\r\n####Arguments\r\n+ uids - array of user ids\r\n+ route - route string\r\n+ msg - messages would be sent to clients\r\n+ cb - callback function\r\n\r\n####Return\r\n+ err - error\r\n+ fails - array of failed to send user ids\r\n\r\n##Notice\r\n\r\nstatus plugin use redis as a default persistent storage, you can change it with your own implementation. \r\n\r\n```\r\nvar status = require('pomelo-status-plugin');\r\nvar mysqlStatusManager = require('./mysqlStatusManager');\r\n\r\napp.use(status, {status: {\r\n host: '127.0.0.1',\r\n port: 6379,\r\n channelManager: mysqlStatusManager\r\n}});\r\n\r\n```\r\nin >=0.0.3 version add cleanOnStartUp option, when you enable this option, status plugin would clean up the old data with the given prefix string.\r\n\r\n```\r\napp.use(status, {status: {\r\n host: '127.0.0.1',\r\n port: 6379,\r\n cleanOnStartUp: true\r\n}});\r\n\r\n```\r\n",
- "readmeFilename": "README.md",
- "description": "pomelo-status-plugin\r ====================",
- "_id": "pomelo-status-plugin@0.0.6",
- "_shasum": "fa17e850278bb1a61a9e6d601b7d6db2a4847360",
- "_resolved": "git+https://github.com/feitianbubu/pomelo-status-plugin.git#8c3fcb15d1c16ec6b8011b061d6ecab2da6d0797",
- "_from": "pomelo-status-plugin@git+https://github.com/feitianbubu/pomelo-status-plugin.git"
- }
|