kubricate
Version:
A TypeScript framework for building reusable, type-safe Kubernetes infrastructure — without the YAML mess.
22 lines • 580 B
JavaScript
/**
* InMemoryConnector is a simple in-memory connector for secrets.
* For testing purposes only.
*/
export class InMemoryConnector {
config;
loaded = /*#__PURE__*/new Set();
constructor(config) {
this.config = config;
}
async load(names) {
for (const name of names) {
if (!(name in this.config)) throw new Error(`Missing secret: ${name}`);
this.loaded.add(name);
}
}
get(name) {
if (!this.loaded.has(name)) throw new Error(`Secret ${name} not loaded`);
return this.config[name];
}
}
//# sourceMappingURL=InMemoryConnector.js.map