IF Commons GitHub

logical/dns

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-linux-services-profiles FR-007

The plan of a DNS zone: from the records wanted and the records found, the ones to create, to update and to remove. A profile removes only what it claims: a record that carries its marker, never the rest of the zone.

import { planDns } from "./dns.ts";
planDns([{ type: "A", name: "a.example.org", content: "192.0.2.1", ttl: 300, proxied: false }], []).create.length; // 1

Source: commons/linux-services/src/logical/dns.ts

3 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.isEmptyconstno test imports it
const isEmpty: (p: DnsPlan) => boolean

Whether a plan changes nothing.

logical.planDnsfunctionno test imports it
function planDns(wanted: readonly DnsRecord[], found: readonly FoundRecord[]): DnsPlan

The plan to make the zone have the records wanted. A wanted name that is found without the marker is updated (the profile lists its exact name and so claims it); a found record that carries the marker and is not wanted is removed; all others are left.

logical.DnsPlantypeno test imports it
type DnsPlan = {
  readonly create: readonly DnsRecord[];
  readonly update: readonly { readonly id: string; readonly record: DnsRecord }[];
  readonly remove: readonly FoundRecord[];
};

What a plan changes.

logical.FoundRecordtypeno test imports it
type FoundRecord = DnsRecord & { readonly id: string; readonly comment: string };

A record as the provider holds it: with its id and its comment.

isEmptyconst
const isEmpty: (p: DnsPlan) => boolean

Whether a plan changes nothing.

Imported by 10 tests of the run (10 passed, 0 failed): the library's results

planDnsfunction
function planDns(wanted: readonly DnsRecord[], found: readonly FoundRecord[]): DnsPlan

The plan to make the zone have the records wanted. A wanted name that is found without the marker is updated (the profile lists its exact name and so claims it); a found record that carries the marker and is not wanted is removed; all others are left.

Imported by 10 tests of the run (10 passed, 0 failed): the library's results

DnsPlantypeno test imports it
type DnsPlan = {
  readonly create: readonly DnsRecord[];
  readonly update: readonly { readonly id: string; readonly record: DnsRecord }[];
  readonly remove: readonly FoundRecord[];
};

What a plan changes.

FoundRecordtype
type FoundRecord = DnsRecord & { readonly id: string; readonly comment: string };

A record as the provider holds it: with its id and its comment.

Imported by 10 tests of the run (10 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.