draft: cache implementation

This commit is contained in:
b1ek 2024-07-29 11:47:33 +10:00
parent 30c538b530
commit 10827918f9
Signed by: blek
GPG Key ID: 14546221E3595D0C
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],
}) })