UNPKG

mastercache

Version:

Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers

30 lines (27 loc) 868 B
import { DriverCommonOptions } from '../types/options/drivers-options.js'; import 'knex'; import 'kysely'; import '@aws-sdk/client-dynamodb'; import 'ioredis'; import 'orchid-orm'; import '../types/helpers.js'; import 'typescript-log'; declare abstract class BaseDriver { #private; protected config: DriverCommonOptions; /** * Current cache prefix */ protected prefix: string; constructor(config: DriverCommonOptions); /** * Creates a namespace prefix by concatenating the cache prefix with the given namespace * If the cache prefix is not defined, the namespace is returned as is */ protected createNamespacePrefix(namespace: string): string; /** * Returns the cache key with the prefix added to it, if a prefix is defined */ protected getItemKey(key: string): string; } export { BaseDriver };