UNPKG

pmcf

Version:

Poor mans configuration management

229 lines (148 loc) 7.75 kB
[![npm](https://img.shields.io/npm/v/pmcf.svg)](https://www.npmjs.com/package/pmcf) [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html) [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org) [![bundlejs](https://deno.bundlejs.com/?q=pmcf\&badge=detailed)](https://bundlejs.com/?q=pmcf) [![downloads](http://img.shields.io/npm/dm/pmcf.svg?style=flat-square)](https://npmjs.org/package/pmcf) [![GitHub Issues](https://img.shields.io/github/issues/arlac77/pmcf.svg?style=flat-square)](https://github.com/arlac77/pmcf/issues) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fpmcf%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/pmcf/goto) [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Known Vulnerabilities](https://snyk.io/test/github/arlac77/pmcf/badge.svg)](https://snyk.io/test/github/arlac77/pmcf) # pmcf ## Poor mans configuration management Generates system packages from config blueprint. supported linux derivates: * arch linux * debian * rpm based systems generates config packages for: * systemd * networkd * timesyncd * resolverd * kea * bind * mosquitto * influxdb * iwd * chrony # API <!-- Generated by documentation.js. Update this documentation by updating the source code. --> ### Table of Contents * [Base](#base) * [Parameters](#parameters) * [extends](#extends) * [findService](#findservice) * [Parameters](#parameters-1) * [PortEndpoint](#portendpoint) * [Parameters](#parameters-2) * [port](#port) * [socketAddress](#socketaddress) * [HTTPEndpoint](#httpendpoint) * [Parameters](#parameters-3) * [port](#port-1) * [SkeletonNetworkInterface](#skeletonnetworkinterface) * [networkAddresses](#networkaddresses) * [Parameters](#parameters-4) * [NetworkAddress](#networkaddress) * [Parameters](#parameters-5) * [subnet](#subnet) * [networkInterface](#networkinterface) * [address](#address) * [addresses](#addresses) * [Parameters](#parameters-6) * [cidrAddresses](#cidraddresses) * [Parameters](#parameters-7) * [serviceEndpoints](#serviceendpoints) * [Parameters](#parameters-8) * [sectionLines](#sectionlines) * [Parameters](#parameters-9) * [asArray](#asarray) * [Parameters](#parameters-10) * [asIterator](#asiterator) * [Parameters](#parameters-11) ## Base ### Parameters * `owner` &#x20; * `data` &#x20; ### extends Returns **Iterable<[Base](#base)>**&#x20; ### findService #### Parameters * `filter` **any**&#x20; Returns **any** service with the highest priority ## PortEndpoint **Extends BaseEndpoint** Endpoint with an ip port ### Parameters * `service` &#x20; * `data` &#x20; ### port Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20; ### socketAddress Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20; ## HTTPEndpoint **Extends BaseEndpoint** Endpoint based on http ### Parameters * `service` &#x20; * `address` &#x20; * `data` &#x20; ### port Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20; ## SkeletonNetworkInterface **Extends ServiceOwner** ### networkAddresses #### Parameters * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`) Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20; ## NetworkAddress ### Parameters * `networkInterface` **NetworkInterface**&#x20; * `address` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array))**&#x20; * `subnet` **Subnet**&#x20; ### subnet Type: Subnet ### networkInterface Type: NetworkInterface ### address Type: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)) ## addresses ### Parameters * `sources` **Iterable<(Owner | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>**&#x20; * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20; * `options.aggregate` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20; * `options.filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20; Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** addresses ## cidrAddresses ### Parameters * `networkAddresses` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[NetworkAddress](#networkaddress)>**&#x20; Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20; ## serviceEndpoints ### Parameters * `sources` **any**&#x20; * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) * `options.services` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** filter for services * `options.endpoints` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** filter for endpoints * `options.select` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** mapper from Endpoint into result * `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** upper limit of # result items * `options.join` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** join result(s) into a string Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | any)**&#x20; ## sectionLines ### Parameters * `sectionName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20; * `values` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20; Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20; ## asArray ### Parameters * `value` **any**&#x20; Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>**&#x20; ## asIterator ### Parameters * `value` **any**&#x20; Returns **Iterable\<any>**&#x20; # install With [npm](http://npmjs.org) do: ```shell npm install pmcf ```