This commit is contained in:
2021-01-16 23:55:27 -05:00
commit 10d10079aa
8070 changed files with 386150 additions and 0 deletions

27
nodejs/utils/redis.js Executable file
View File

@@ -0,0 +1,27 @@
'use strict';
const {createClient} = require('redis');
const {promisify} = require('util');
const config = {
prefix: 'sso_'
}
function client() {
return createClient(config);
}
const _client = client();
module.exports = {
client: client,
HGET: promisify(_client.HGET).bind(_client),
HDEL: promisify(_client.HDEL).bind(_client),
SADD: promisify(_client.SADD).bind(_client),
SREM: promisify(_client.SREM).bind(_client),
DEL: promisify(_client.DEL).bind(_client),
HSET: promisify(_client.HSET).bind(_client),
HGETALL: promisify(_client.HGETALL).bind(_client),
SMEMBERS: promisify(_client.SMEMBERS).bind(_client),
RENAME: promisify(_client.RENAME).bind(_client),
};