2021-04-23 18:41:30 +00:00
|
|
|
import { CacheEntry } from './levelcache.classes.cacheentry';
|
2021-04-23 18:40:57 +00:00
|
|
|
|
|
|
|
export abstract class AbstractCache {
|
|
|
|
public abstract ready: Promise<void>;
|
|
|
|
public abstract status: 'active' | 'inactive';
|
2021-04-23 18:41:30 +00:00
|
|
|
|
2021-04-23 18:40:57 +00:00
|
|
|
// Blobs
|
|
|
|
/**
|
|
|
|
* store a Blob
|
|
|
|
*/
|
|
|
|
public abstract storeCacheEntryByKey(keyArg: string, valueArg: CacheEntry): Promise<void>;
|
|
|
|
|
|
|
|
// Cache Entries
|
|
|
|
/**
|
|
|
|
* retrieve cache entry
|
|
|
|
*/
|
|
|
|
public abstract retrieveCacheEntryByKey(keyArg: string): Promise<CacheEntry>;
|
|
|
|
|
|
|
|
public abstract checkKeyPresence(keyArg: string): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cleans the cache
|
|
|
|
*/
|
|
|
|
public abstract clean(): Promise<void>;
|
2021-04-23 18:41:30 +00:00
|
|
|
}
|