fix(core): update
This commit is contained in:
parent
1cdba38408
commit
26511fc10e
@ -25,7 +25,8 @@
|
||||
"@pushrocks/smartbucket": "^1.0.24",
|
||||
"@pushrocks/smartcache": "^1.0.13",
|
||||
"@pushrocks/smartfile": "^7.0.6",
|
||||
"@pushrocks/smartstring": "^3.0.18"
|
||||
"@pushrocks/smartstring": "^3.0.18",
|
||||
"@pushrocks/smartunique": "^3.0.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
@ -1,5 +1,10 @@
|
||||
import * as plugins from './levelcache.plugins';
|
||||
|
||||
export class CacheEntry {
|
||||
|
||||
type: 'string' | 'blob';
|
||||
mode: 'complete' | 'stream';
|
||||
keyArg: string;
|
||||
cacheStream: ReadableStream;
|
||||
cacheContents: Buffer;
|
||||
cacheValue: string;
|
||||
}
|
6
ts/levelcache.classes.cacherouter.ts
Normal file
6
ts/levelcache.classes.cacherouter.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import * as plugins from './levelcache.plugins';
|
||||
|
||||
export class CacheRouter {
|
||||
async routeStoreAction() {}
|
||||
async routeRetrieveAction() {}
|
||||
}
|
@ -2,6 +2,7 @@ import * as plugins from './levelcache.plugins';
|
||||
import { CacheDiskManager } from './levelcache.classes.cache.diskmanager';
|
||||
import { CacheMemoryManager } from './levelcache.classes.cache.memorymanager';
|
||||
import { CacheS3Manager } from './levelcache.classes.cache.s3manager';
|
||||
import { CacheEntry } from './levelcache.classes.cacheentry';
|
||||
|
||||
/**
|
||||
* a leveled cache for storing things for a short time
|
||||
@ -12,31 +13,48 @@ export class LevelCache {
|
||||
public cacheMemoryManager = new CacheMemoryManager();
|
||||
public cacheS3Manager = new CacheS3Manager();
|
||||
|
||||
private processKey (keyArg: string) {
|
||||
if (!keyArg) {
|
||||
return plugins.smartunique.shortId();
|
||||
}
|
||||
}
|
||||
|
||||
// Blobs
|
||||
/**
|
||||
* store a Blob
|
||||
*/
|
||||
public async storeBlobByKey () {};
|
||||
public async storeBlobByKey (keyArg: string, blob: Buffer) {
|
||||
keyArg = this.processKey(keyArg);
|
||||
return keyArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve a blob
|
||||
*/
|
||||
public async retrieveBlob () {};
|
||||
public async retrieveBlob (keyArg: string): CacheEntry {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Cache Entries
|
||||
/**
|
||||
* store a Cache Entries
|
||||
*/
|
||||
public async storeCacheEntry() {};
|
||||
public async storeCacheEntry(cacheEntryArg: CacheEntry): string {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve cache entry
|
||||
*/
|
||||
public async retrieveCacheEntry () {};
|
||||
public async retrieveCacheEntry (): CacheEntry {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* cleans the cache
|
||||
*/
|
||||
public clean() {};
|
||||
public clean() {
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -11,11 +11,13 @@ import * as smartbucket from '@pushrocks/smartbucket';
|
||||
import * as smartcache from '@pushrocks/smartcache';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartstring from '@pushrocks/smartstring';
|
||||
import * as smartunique from '@pushrocks/smartunique';
|
||||
|
||||
export {
|
||||
lik,
|
||||
smartbucket,
|
||||
smartcache,
|
||||
smartfile,
|
||||
smartstring
|
||||
smartstring,
|
||||
smartunique
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user