{"modulePath":"github.com/GoCodeAlone/workflow-plugin-hover","version":"v0.6.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package drivers\n\nPackage-doc additions in this file are scoped to the dns\\_delegation driver. See dns.go for the prior infra.dns driver.\n\nPackage drivers provides IaC ResourceDriver implementations for the Hover DNS provider.\n\nHover exposes NO official API. All endpoints below are derived from [https://github.com/pjslauta/hover-dyn-dns](https://github.com/pjslauta/hover-dyn-dns) and browser traffic inspection. Endpoint inventory (all relative to [https://www.hoverclient.com](https://www.hoverclient.com)):\n\n\tGET  /api/domains/\u003cdomain\u003e/dns       — list records for a zone\n\tPOST /api/dns                         — create a record (form: domain_id, name, type, content, ttl)\n\tPUT  /api/dns/\u003cid\u003e                    — update a record (form: content, ttl)\n\tDELETE /api/dns/\u003cid\u003e                  — delete a record\n\nThese are undocumented; the Hover site uses them directly from the control panel SPA. They may change without notice.\n\n## Types\n\n```go\ntype DNSDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nDNSDriver manages Hover DNS zones and records (infra.dns). ProviderID is the apex domain name (e.g. \"example.com\").\n\n```go\nfunc NewDNSDriver(c *hoverclient.Client) *DNSDriver\n```\nNewDNSDriver creates a DNSDriver backed by a real hoverclient.Client.\n\n```go\nfunc NewDNSDriverWithClient(c HoverDNSClient) *DNSDriver\n```\nNewDNSDriverWithClient creates a driver with an injected client (for tests).\n\n```go\nfunc (d *DNSDriver) Create(ctx context.Context, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\nCreate idempotently reconciles a DNS zone on Hover. It creates missing records and updates existing ones that differ. Hover does not support creating zones via API — the domain must already be registered and in the account.\n\nConfig keys:\n\n\tdomain   string      — apex zone name (e.g. \"example.com\"). Falls back to spec.Name.\n\trecords  []any       — each element: {type, name, content, ttl?}\n\n```go\nfunc (d *DNSDriver) Delete(_ context.Context, _ interfaces.ResourceRef) error\n```\n\n```go\nfunc (d *DNSDriver) Diff(_ context.Context, desired interfaces.ResourceSpec, current *interfaces.ResourceOutput) (*interfaces.DiffResult, error)\n```\n\n```go\nfunc (d *DNSDriver) HealthCheck(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.HealthResult, error)\n```\n\n```go\nfunc (d *DNSDriver) ProviderIDFormat() interfaces.ProviderIDFormat\n```\n\n```go\nfunc (d *DNSDriver) Read(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *DNSDriver) Scale(_ context.Context, _ interfaces.ResourceRef, _ int) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *DNSDriver) SensitiveKeys() []string\n```\n\n```go\nfunc (d *DNSDriver) Update(ctx context.Context, ref interfaces.ResourceRef, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\n\n```go\ntype DelegationDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nDelegationDriver manages registrar-level nameserver delegation (infra.dns\\_delegation) for Hover-registered domains.\n\nProviderID = apex domain name (e.g. \"example.com\"). One resource = one domain. Outputs contain only the desired nameservers as \\[]any (structpb-safe). v0.2.0 ships Delete = reset to Hover defaults \\[ns1.hoverclient.com, ns2.hoverclient.com]; restore-from-stash is deferred to v0.3.0 because interfaces.ResourceRef has no state channel.\n\n```go\nfunc NewDelegationDriver(c *hoverclient.Client) *DelegationDriver\n```\nNewDelegationDriver returns a DelegationDriver bound to a real \\*hoverclient.Client.\n\n```go\nfunc NewDelegationDriverWithClient(c HoverDelegationClient) *DelegationDriver\n```\nNewDelegationDriverWithClient returns a DelegationDriver bound to an injected client; used by tests.\n\n```go\nfunc NewDelegationDriverWithClientAndResolver(c HoverDelegationClient, resolver func(context.Context, string) ([]string, error)) *DelegationDriver\n```\nNewDelegationDriverWithClientAndResolver returns a DelegationDriver bound to an injected client and public-NS resolver; used by tests.\n\n```go\nfunc (d *DelegationDriver) AdoptionRef(spec interfaces.ResourceSpec) (interfaces.ResourceRef, bool, error)\n```\nAdoptionRef lets wfctl adopt an already-delegated domain before creating registrar state. Read uses public NS first, so an already-correct delegation can plan as no-op without requiring Hover authentication.\n\n```go\nfunc (d *DelegationDriver) Create(ctx context.Context, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\nCreate PUTs the desired nameservers. Output built from the desired set (no read-after-write); SetNameservers is authoritative on success.\n\n```go\nfunc (d *DelegationDriver) Delete(ctx context.Context, ref interfaces.ResourceRef) error\n```\nDelete resets the registrar nameservers to Hover's defaults. Operators whose domains had non-default originals must restore manually via the Hover UI if a Delete fires unintended.\n\n```go\nfunc (d *DelegationDriver) Diff(ctx context.Context, desired interfaces.ResourceSpec, current *interfaces.ResourceOutput) (*interfaces.DiffResult, error)\n```\nDiff compares desired vs current. Multiset semantics on nameservers (order-independent — Hover accepts any order on PUT). Domain rename (desired vs current.ProviderID) forces Replace.\n\n```go\nfunc (d *DelegationDriver) HealthCheck(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.HealthResult, error)\n```\nHealthCheck probes connectivity to the domain by fetching its delegation.\n\n```go\nfunc (d *DelegationDriver) ProviderIDFormat() interfaces.ProviderIDFormat\n```\n\n```go\nfunc (d *DelegationDriver) Read(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.ResourceOutput, error)\n```\nRead fetches the current registrar nameservers.\n\n```go\nfunc (d *DelegationDriver) ReadForImport(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.ResourceOutput, error)\n```\nReadForImport fetches both the registrar (authoritative) and live public nameservers, returning them in a single ResourceOutput. Unlike Read, this method always calls GetDomainDelegation first (registrar = authoritative intent); the live resolver is called best-effort and its result is omitted if unavailable. The primary \"nameservers\" key equals the registrar NS so existing Diff / nameserversFromOutputs semantics remain consistent.\n\nThis is the import-path equivalent of Read; it MUST NOT be used for drift detection or apply (those continue to use Read).\n\n```go\nfunc (d *DelegationDriver) Scale(_ context.Context, _ interfaces.ResourceRef, _ int) (*interfaces.ResourceOutput, error)\n```\nScale is not supported for DNS delegation (no replica concept).\n\n```go\nfunc (d *DelegationDriver) SensitiveKeys() []string\n```\n\n```go\nfunc (d *DelegationDriver) Type() string\n```\n\n```go\nfunc (d *DelegationDriver) Update(ctx context.Context, ref interfaces.ResourceRef, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\nUpdate replaces the registrar nameservers. Rejects in-place domain renames (those must route through Diff → NeedsReplace → Delete-then-Create).\n\n```go\ntype DomainDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nDomainDriver manages registrar-level domain settings for Hover domains.\n\n```go\nfunc NewDomainDriver(c *hoverclient.Client) *DomainDriver\n```\n\n```go\nfunc NewDomainDriverWithClient(c HoverDomainClient) *DomainDriver\n```\n\n```go\nfunc (d *DomainDriver) AdoptionRef(spec interfaces.ResourceSpec) (interfaces.ResourceRef, bool, error)\n```\n\n```go\nfunc (d *DomainDriver) Create(ctx context.Context, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *DomainDriver) Delete(_ context.Context, ref interfaces.ResourceRef) error\n```\n\n```go\nfunc (d *DomainDriver) Diff(_ context.Context, desired interfaces.ResourceSpec, current *interfaces.ResourceOutput) (*interfaces.DiffResult, error)\n```\n\n```go\nfunc (d *DomainDriver) HealthCheck(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.HealthResult, error)\n```\n\n```go\nfunc (d *DomainDriver) ProviderIDFormat() interfaces.ProviderIDFormat\n```\n\n```go\nfunc (d *DomainDriver) Read(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *DomainDriver) Scale(_ context.Context, _ interfaces.ResourceRef, _ int) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *DomainDriver) SensitiveKeys() []string\n```\n\n```go\nfunc (d *DomainDriver) Update(ctx context.Context, ref interfaces.ResourceRef, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\n\n```go\ntype HoverDNSClient interface {\n\tGetDomain(ctx context.Context, domain string) (*hoverclient.Domain, error)\n\tListRecords(ctx context.Context, domain string) ([]hoverclient.DNSRecord, error)\n\tCreateRecord(ctx context.Context, domainID string, rec hoverclient.DNSRecord) (*hoverclient.DNSRecord, error)\n\tUpdateRecord(ctx context.Context, recordID string, rec hoverclient.DNSRecord) error\n\tDeleteRecord(ctx context.Context, recordID string) error\n}\n```\nHoverDNSClient is the subset of hoverclient.Client used by DNSDriver (injectable for tests).\n\n```go\ntype HoverDelegationClient interface {\n\tGetDomainDelegation(ctx context.Context, domain string) (*hoverclient.DomainDelegation, error)\n\tSetNameservers(ctx context.Context, domain string, ns []string) error\n}\n```\nHoverDelegationClient is the subset of \\*hoverclient.Client that DelegationDriver depends on. Injectable for tests.\n\n```go\ntype HoverDomainClient interface {\n\tGetTransferLock(ctx context.Context, domain string) (bool, error)\n\tSetTransferLock(ctx context.Context, domain string, locked bool) error\n}\n```\nHoverDomainClient is the subset of hoverclient.Client used by DomainDriver.\n\n```go\ntype HoverRedirectClient interface {\n\tGetForward(ctx context.Context, domain string) (*hoverclient.DomainForward, error)\n\tSetForward(ctx context.Context, domain string, forward hoverclient.DomainForward) error\n}\n```\nHoverRedirectClient is the subset of hoverclient.Client used by RedirectDriver.\n\n```go\ntype RedirectDriver struct {\n\t// contains filtered or unexported fields\n}\n```\nRedirectDriver manages Hover root web forwards.\n\n```go\nfunc NewRedirectDriver(c *hoverclient.Client) *RedirectDriver\n```\n\n```go\nfunc NewRedirectDriverWithClient(c HoverRedirectClient) *RedirectDriver\n```\n\n```go\nfunc (d *RedirectDriver) AdoptionRef(spec interfaces.ResourceSpec) (interfaces.ResourceRef, bool, error)\n```\n\n```go\nfunc (d *RedirectDriver) Create(ctx context.Context, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *RedirectDriver) Delete(_ context.Context, ref interfaces.ResourceRef) error\n```\n\n```go\nfunc (d *RedirectDriver) Diff(_ context.Context, desired interfaces.ResourceSpec, current *interfaces.ResourceOutput) (*interfaces.DiffResult, error)\n```\n\n```go\nfunc (d *RedirectDriver) HealthCheck(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.HealthResult, error)\n```\n\n```go\nfunc (d *RedirectDriver) ProviderIDFormat() interfaces.ProviderIDFormat\n```\n\n```go\nfunc (d *RedirectDriver) Read(ctx context.Context, ref interfaces.ResourceRef) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *RedirectDriver) Scale(ctx context.Context, ref interfaces.ResourceRef, _ int) (*interfaces.ResourceOutput, error)\n```\n\n```go\nfunc (d *RedirectDriver) SensitiveKeys() []string\n```\n\n```go\nfunc (d *RedirectDriver) Update(ctx context.Context, ref interfaces.ResourceRef, spec interfaces.ResourceSpec) (*interfaces.ResourceOutput, error)\n```\n\n","path":"github.com/GoCodeAlone/workflow-plugin-hover/internal/drivers","name":"drivers","synopsis":"Package-doc additions in this file are scoped to the dns_delegation driver.","isRedistributable":true}
