levelcache/ts/levelcache.abstract.classes.cache.ts

39 lines
873 B
TypeScript
Raw Permalink Normal View History

2022-03-22 21:45:12 +00:00
import { CacheEntry } from './levelcache.classes.cacheentry.js';
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
// Cache Entries
2021-04-23 18:40:57 +00:00
/**
* store a Blob
*/
public abstract storeCacheEntryByKey(keyArg: string, valueArg: CacheEntry): Promise<void>;
/**
* retrieve cache entry
*/
public abstract retrieveCacheEntryByKey(keyArg: string): Promise<CacheEntry>;
/**
* checks for the presence of a key
* @param keyArg
*/
2021-04-23 18:40:57 +00:00
public abstract checkKeyPresence(keyArg: string): Promise<boolean>;
/**
* delete a key
*/
2022-03-22 21:45:12 +00:00
public abstract deleteCacheEntryByKey(keyArg: string): Promise<void>;
/**
* clean the cache
*/
public abstract cleanOutdated(): Promise<void>;
/**
* cleans the complete cache
2021-04-23 18:40:57 +00:00
*/
public abstract cleanAll(): Promise<void>;
2021-04-23 18:41:30 +00:00
}