MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / createCache

Function createCache

cli/src/cache/index.ts:41–58  ·  view source on GitHub ↗
(
    logger: Logger,
    config: Config,
    credentials: Credentials,
    cacheFileName: string,
)

Source from the content-addressed store, hash-verified

39}
40
41function createCache(
42 logger: Logger,
43 config: Config,
44 credentials: Credentials,
45 cacheFileName: string,
46): ProtonDriveCache<string> {
47 const cacheFile = path.join(config.cacheDir, cacheFileName);
48 if (config.unsafeCache) {
49 return new SQLiteCache(cacheFile);
50 }
51 return new EncryptedSQLiteCache(
52 cacheFile,
53 async () => {
54 return credentials.getCachePassword();
55 },
56 logger,
57 );
58}

Callers 2

createCryptoCacheFunction · 0.85
createEntitiesCacheFunction · 0.85

Calls 1

getCachePasswordMethod · 0.80

Tested by

no test coverage detected