Comparing version 1.0.2 to 2.0.0
@@ -27,9 +27,10 @@ 'use strict'; | ||
// db: 'db', | ||
// },{ | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// }]}, | ||
// },{ | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// }, | ||
// ]}, | ||
@@ -39,16 +40,16 @@ // Multi Redis | ||
// instance1: { | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// }, | ||
// instance2: { | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// host: 'host', | ||
// port: 'port', | ||
// family: 'user', | ||
// password: 'password', | ||
// db: 'db', | ||
// }, | ||
// }, | ||
}; |
2.0.0 / 2018-02-27 | ||
================== | ||
**others** | ||
* [[`70e85e2`](http://github.com/eggjs/egg-redis/commit/70e85e2710c729245281b78007be4d84fba10dbe)] - chore: add package.files (dead-horse <<dead_horse@qq.com>>) | ||
* [[`45585e8`](http://github.com/eggjs/egg-redis/commit/45585e81ff30bd2e98241c924605272b516f9b9a)] - chore: update dependencies and fix ci (#16) (Yiyu He <<dead_horse@qq.com>>) | ||
* [[`8b88641`](http://github.com/eggjs/egg-redis/commit/8b886413ff60539b4e53fce50cfc8be0790d0612)] - refactor: use async function (#15) (QIAO <<445271466@qq.com>>) | ||
* [[`8dd3776`](http://github.com/eggjs/egg-redis/commit/8dd3776c346e22c7e9afc14a141c026f7d6dd7ae)] - deps: Update ioredis (#14) (thegatheringstorm <<tgs@tgs.blue>>) | ||
* [[`59d9579`](http://github.com/eggjs/egg-redis/commit/59d9579f37d5b54d62674d1ab3ba1274537b5590)] - docs: fix some typo (#13) (kyle <<succpeking@hotmail.com>>) | ||
* [[`de17719`](http://github.com/eggjs/egg-redis/commit/de17719f93bf566f5499d8ceb3f4588de3f2d7d3)] - docs:add nopassword doc (#12) (Adams <<jtyjty99999@126.com>>) | ||
* [[`5b0dd99`](http://github.com/eggjs/egg-redis/commit/5b0dd9963d1e78e34ebe6fb6ac7aaa663ee23115)] - chore:bump to 1.0.2 (jtyjty99999 <<jtyjty99999@126.com>>), | ||
1.0.2 / 2017-07-13 | ||
@@ -3,0 +15,0 @@ ================== |
@@ -48,4 +48,4 @@ 'use strict'; | ||
app.beforeStart(function* () { | ||
const result = yield client.info(); | ||
app.beforeStart(async () => { | ||
const result = await client.info(); | ||
const index = count++; | ||
@@ -52,0 +52,0 @@ app.coreLogger.info(`[egg-redis] instance[${index}] status OK, redis currentTime: ${result[0]}`); |
{ | ||
"name": "egg-redis", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"description": "Redis plugin for egg", | ||
@@ -8,2 +8,8 @@ "eggPlugin": { | ||
}, | ||
"files": [ | ||
"app.js", | ||
"agent.js", | ||
"lib", | ||
"config" | ||
], | ||
"keywords": [ | ||
@@ -17,12 +23,12 @@ "egg", | ||
"dependencies": { | ||
"ioredis": "^2.5.0" | ||
"ioredis": "^3.2.2" | ||
}, | ||
"devDependencies": { | ||
"autod": "^2.7.1", | ||
"egg": "^1.0.0-rc.2", | ||
"egg-bin": "^2.2.3", | ||
"egg-ci": "^1.3.0", | ||
"egg-mock": "^3.0.1", | ||
"eslint": "^3.16.1", | ||
"eslint-config-egg": "^3.2.0", | ||
"autod": "^3.0.1", | ||
"egg": "^2.3.0", | ||
"egg-bin": "^4.4.0", | ||
"egg-ci": "^1.8.0", | ||
"egg-mock": "^3.14.0", | ||
"eslint": "^4.18.1", | ||
"eslint-config-egg": "^7.0.0", | ||
"supertest": "^3.0.0", | ||
@@ -44,3 +50,3 @@ "utility": "^1.9.0" | ||
"type": "travis", | ||
"version": "6, 7", | ||
"version": "8, 9", | ||
"license": true, | ||
@@ -47,0 +53,0 @@ "services": "redis-server" |
@@ -82,2 +82,21 @@ # egg-redis | ||
**No password** | ||
Redis support no authentication access, but we are highly recommand you to use redis `requirepass` in `redis.conf`. | ||
```bash | ||
$vim /etc/redis/redis.conf | ||
requirepass xxxxxxxxxx // xxxxxxxxxx是你的密码 | ||
``` | ||
Because it may be cause security risk, refer: | ||
- https://ruby-china.org/topics/28094 | ||
- https://zhuoroger.github.io/2016/07/29/redis-sec/ | ||
If you want to access redis with no password, use `password: null`. | ||
See [ioredis API Documentation](https://github.com/luin/ioredis/blob/master/API.md#new_Redis) for all available options. | ||
@@ -94,8 +113,8 @@ | ||
return class HomeController extends app.Controller { | ||
* index() { | ||
async index() { | ||
const { ctx, app } = this; | ||
// set | ||
yield app.redis.set('foo', 'bar'); | ||
await app.redis.set('foo', 'bar'); | ||
// get | ||
ctx.body = yield app.redis.get('foo'); | ||
ctx.body = await app.redis.get('foo'); | ||
} | ||
@@ -115,8 +134,8 @@ }; | ||
return class HomeController extends app.Controller { | ||
* index() { | ||
async index() { | ||
const { ctx, app } = this; | ||
// set | ||
yield app.redis.get('instance1').set('foo', 'bar'); | ||
await app.redis.get('instance1').set('foo', 'bar'); | ||
// get | ||
ctx.body = yield app.redis..get('instance1').get('foo'); | ||
ctx.body = await app.redis.get('instance1').get('foo'); | ||
} | ||
@@ -161,8 +180,8 @@ }; | ||
return class HomeController extends app.Controller { | ||
* index() { | ||
async index() { | ||
const { ctx, app } = this; | ||
// set | ||
yield app.redis.set('foo', 'bar'); | ||
await app.redis.set('foo', 'bar'); | ||
// get | ||
ctx.body = yield app.redis.get('foo'); | ||
ctx.body = await app.redis.get('foo'); | ||
} | ||
@@ -169,0 +188,0 @@ }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196
11862
8
103
+ Addeddenque@1.5.1(transitive)
+ Addedioredis@3.2.2(transitive)
+ Addedlodash.assign@4.2.0(transitive)
+ Addedlodash.bind@4.2.1(transitive)
+ Addedlodash.clone@4.5.0(transitive)
+ Addedlodash.clonedeep@4.5.0(transitive)
+ Addedlodash.defaults@4.2.0(transitive)
+ Addedlodash.difference@4.5.0(transitive)
+ Addedlodash.flatten@4.4.0(transitive)
+ Addedlodash.foreach@4.5.0(transitive)
+ Addedlodash.isempty@4.4.0(transitive)
+ Addedlodash.keys@4.2.0(transitive)
+ Addedlodash.noop@3.0.1(transitive)
+ Addedlodash.partial@4.2.1(transitive)
+ Addedlodash.pick@4.4.0(transitive)
+ Addedlodash.sample@4.2.1(transitive)
+ Addedlodash.shuffle@4.2.0(transitive)
+ Addedlodash.values@4.3.0(transitive)
+ Addedredis-parser@2.6.0(transitive)
- Removeddouble-ended-queue@2.1.0-0(transitive)
- Removedioredis@2.5.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedredis-parser@1.3.0(transitive)
Updatedioredis@^3.2.2