Defdo.DDNS.Reconcile.Inventory (defdo_ddns v0.5.0)

Copy Markdown

Answers one question truthfully, for one zone: which live Cloudflare records do we declare, which do we not, and which do we declare but are absent?

Strictly read-only. It never writes to Cloudflare and never adopts anything; deciding what to do with an undeclared record is Defdo.DDNS.Adoption's job.

Records are classified by identity — the {type, name} pair — not by content. A declared record whose live content has drifted is still managed: converging it is the monitor's work, and reporting it as missing would invite adopting a record we already own.

Only the types DDNS manages (A, AAAA, CNAME) are considered. Anything else in the zone — MX, TXT, NS — is not ours and must never surface as unmanaged, or every zone would look like it needed adopting.

Summary

Functions

Classify a zone's live records against what DDNS declares.

Types

report()

@type report() :: %{required(String.t()) => String.t() | list() | map()}

Functions

inventory(domain)

@spec inventory(String.t()) :: {:ok, report()} | {:error, term()}

Classify a zone's live records against what DDNS declares.

Returns {:ok, report} or {:error, reason}. It reports an error rather than a partial answer whenever the truth is unknown: a failed listing must never be read as "the zone is empty", which downstream would mean "every declared record vanished" and "nothing is declared" at once.