UNPKG

@nasriya/orchestriq

Version:

A package to generate Docker files

26 lines (25 loc) 829 B
import StackNetwork from "./StackNetwork.js"; class ServicesNetworksManager { #_container; #_networks = {}; constructor(container) { this.#_container = container; } /** * Creates a new network and adds it to the container. * @param network The data for the network to create. * @returns The created network. * @throws {Error} If a network with the same name already exists. */ create(network) { const nw = new StackNetwork(network, this.#_container); this.#_networks[nw.name] = nw; return nw; } /** * Returns a record of all networks in the container. * @returns {Record<string, StackNetwork>} A record of all networks in the container. */ get list() { return this.#_networks; } } export default ServicesNetworksManager;