ReadDns
Source:
src/Hetzner/ReadDns.ts
Binding that lets runtime code read Hetzner Cloud DNS RRSets.
Authenticates with the ambient HCLOUD_TOKEN (a project-scoped Cloud
API token). The zone is fixed by ReadDns(zone) so calls take no
zone id. Provide ReadDnsHttp on the Action / Function Effect.
Reading RRSets at runtime
Section titled “Reading RRSets at runtime”Bind the client in the Action’s Init phase and provide ReadDnsHttp.
Pass the Zone resource directly (it’s an Effect), or
yield* Zone for a resolved value.
import * as Alchemy from "alchemy";import * as Hetzner from "alchemy/Hetzner";import * as Effect from "effect/Effect";
const Check = Alchemy.Action( "Check", Effect.gen(function* () { const dns = yield* Hetzner.ReadDns(zone); return Effect.fn(function* () { const listed = yield* dns.listRecordSets({ type: ["A"] }); const rrset = yield* dns.getRecordSet("www", "A"); return { listed, rrset }; }); }).pipe(Effect.provide(Hetzner.ReadDnsHttp)),);