Documentation
¶
Overview ¶
Package dns abstracts a managed DNS host behind one small Provider interface, backed by libdns modules. It mirrors the blob.Store pattern: adding a host later is a new case in Build, not a new client. Miabi manages only the records it owns — never a user's other records.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
Credentials is a provider's credential blob, keyed by the field names its dnscatalog descriptor declares. Wire-compatible with the flat struct it replaced.
type Provider ¶
type Provider interface {
// GetRecords lists the records in a zone (used by test + conflict checks).
GetRecords(ctx context.Context, zone string) ([]Record, error)
// SetRecord upserts a record (creates or replaces the RRset for name+type).
SetRecord(ctx context.Context, zone string, rec Record) error
// DeleteRecord removes a record.
DeleteRecord(ctx context.Context, zone string, rec Record) error
// Test validates the credentials against a zone (a successful GetRecords).
Test(ctx context.Context, zone string) error
}
Provider is Miabi's view of a DNS host. Implementations are idempotent and safe for concurrent use (libdns guarantees the latter).
type Record ¶
type Record struct {
Type string `json:"type"` // TXT | A | AAAA | CNAME
Name string `json:"name"` // FQDN, e.g. _miabi-challenge.example.com
Value string `json:"value"` // record data
TTL time.Duration `json:"-"` // 0 = provider default
}
Record is Miabi's provider-agnostic view of a DNS record. Name is a FQDN (the adapter relativizes it to the zone); Value is the record data (TXT text, A/AAAA IP, CNAME target).