Compare commits

...

1 Commits

Author SHA1 Message Date
b1ek 10827918f9
draft: cache implementation 2024-07-29 11:47:33 +10:00
2 changed files with 23 additions and 1 deletions

21
src/keys/cache/cache.provider.ts vendored Normal file
View File

@ -0,0 +1,21 @@
import { Injectable } from "@nestjs/common";
import { Indexes } from "../indexes.js";
import { GetOperationResult } from "../providers/abstract.provider.js";
export type CacheRowData = Indexes | GetOperationResult;
class CacheRow {
data: CacheRowData;
expires: Date;
}
const cache = [] as CacheRow[];
@Injectable()
export class KeysCacheProvider {
put(data: CacheRowData) {
}
}

View File

@ -3,9 +3,10 @@ import { HKPController } from './controllers/hkp.controller.js'
import { OpenPGPKeysProvider } from './providers/openpgp.provider.js' import { OpenPGPKeysProvider } from './providers/openpgp.provider.js'
import { AllKeysProvider } from './providers/all.provider.js' import { AllKeysProvider } from './providers/all.provider.js'
import { UbuntuKeysProvider } from './providers/ubuntu.provider.js' import { UbuntuKeysProvider } from './providers/ubuntu.provider.js'
import { KeysCacheProvider } from './cache/cache.provider.js'
@Module({ @Module({
providers: [OpenPGPKeysProvider, UbuntuKeysProvider, AllKeysProvider], providers: [OpenPGPKeysProvider, UbuntuKeysProvider, AllKeysProvider, KeysCacheProvider],
controllers: [HKPController], controllers: [HKPController],
exports: [OpenPGPKeysProvider, UbuntuKeysProvider, AllKeysProvider], exports: [OpenPGPKeysProvider, UbuntuKeysProvider, AllKeysProvider],
}) })