UNPKG

kubricate

Version:

A TypeScript framework for building reusable, type-safe Kubernetes infrastructure — without the YAML mess.

29 lines (28 loc) 736 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemoryConnector = void 0; /** * InMemoryConnector is a simple in-memory connector for secrets. * For testing purposes only. */ 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]; } } exports.InMemoryConnector = InMemoryConnector; //# sourceMappingURL=InMemoryConnector.js.map