koatty_store
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,1 @@ | ||
import { MemcacheStore } from "./memcache"; | ||
import { RedisStore } from "./redis"; | ||
@@ -7,16 +6,5 @@ /** | ||
* @export | ||
* @enum {number} | ||
*/ | ||
export declare enum StoreType { | ||
"redis" = "redis", | ||
"memcache" = "memcache" | ||
} | ||
/** | ||
* | ||
* | ||
* @export | ||
* @interface StoreOptions | ||
*/ | ||
export interface StoreOptions { | ||
type: StoreType; | ||
key_prefix: string; | ||
@@ -40,8 +28,2 @@ host: string; | ||
/** | ||
* Creates an instance of Store. | ||
* @param {StoreOptions} options | ||
* @memberof Store | ||
*/ | ||
constructor(options: StoreOptions); | ||
/** | ||
* | ||
@@ -53,3 +35,3 @@ * | ||
*/ | ||
static getInstance(options: StoreOptions): MemcacheStore | RedisStore; | ||
static getInstance(options: StoreOptions): RedisStore; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Store = exports.StoreType = void 0; | ||
exports.Store = void 0; | ||
/* | ||
@@ -8,7 +8,6 @@ * @Author: richen | ||
* @LastEditors: linyyyang<linyyyang@tencent.com> | ||
* @LastEditTime: 2020-11-30 17:47:47 | ||
* @LastEditTime: 2020-12-01 17:37:40 | ||
* @License: BSD (3-Clause) | ||
* @Copyright (c) - <richenlin(at)gmail.com> | ||
*/ | ||
const memcache_1 = require("./memcache"); | ||
const redis_1 = require("./redis"); | ||
@@ -19,13 +18,2 @@ /** | ||
* @export | ||
* @enum {number} | ||
*/ | ||
var StoreType; | ||
(function (StoreType) { | ||
StoreType["redis"] = "redis"; | ||
StoreType["memcache"] = "memcache"; | ||
})(StoreType = exports.StoreType || (exports.StoreType = {})); | ||
/** | ||
* | ||
* | ||
* @export | ||
* @class Store | ||
@@ -35,10 +23,2 @@ */ | ||
/** | ||
* Creates an instance of Store. | ||
* @param {StoreOptions} options | ||
* @memberof Store | ||
*/ | ||
constructor(options) { | ||
return Store.getInstance(options); | ||
} | ||
/** | ||
* | ||
@@ -63,10 +43,3 @@ * | ||
}; | ||
switch (options.type) { | ||
case "memcache": | ||
this.instance = new memcache_1.MemcacheStore(options); | ||
break; | ||
default: | ||
this.instance = new redis_1.RedisStore(options); | ||
break; | ||
} | ||
this.instance = new redis_1.RedisStore(options); | ||
return this.instance; | ||
@@ -73,0 +46,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
* @LastEditors: linyyyang<linyyyang@tencent.com> | ||
* @LastEditTime: 2020-11-30 17:36:28 | ||
* @LastEditTime: 2020-12-01 17:37:59 | ||
* @License: BSD (3-Clause) | ||
@@ -12,0 +12,0 @@ * @Copyright (c) - <richenlin(at)gmail.com> |
{ | ||
"name": "koatty_store", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Cache store for koatty.", | ||
@@ -48,3 +48,2 @@ "scripts": { | ||
"@types/lodash": "^4.x.x", | ||
"@types/memcached": "^2.2.6", | ||
"@types/node": "^12.x.x", | ||
@@ -61,5 +60,4 @@ "del-cli": "^3.0.1", | ||
"koatty_lib": "^1.x.x", | ||
"koatty_logger": "^1.x.x", | ||
"memcached": "^2.2.2" | ||
"koatty_logger": "^1.x.x" | ||
} | ||
} |
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
4
9
85342
12
975
- Removedmemcached@^2.2.2
- Removedconnection-parse@0.0.7(transitive)
- Removedhashring@3.2.0(transitive)
- Removedjackpot@0.0.6(transitive)
- Removedmemcached@2.2.2(transitive)
- Removedretry@0.6.0(transitive)
- Removedsimple-lru-cache@0.0.2(transitive)