Document the package, exported constants, and remaining helpers.

godoc now covers ActionAdd/ActionDelete, internal helpers, and UDP-then-TCP UPDATE behaviour.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Konrad Neitzel
2026-08-25 20:57:02 +02:00
co-authored by Cursor
parent f31924448b
commit ad0bb4533e
5 changed files with 21 additions and 4 deletions
+4 -1
View File
@@ -12,7 +12,9 @@ import (
type Action int
const (
// ActionAdd inserts a record.
ActionAdd Action = iota
// ActionDelete removes a matching RR (name, type, and rdata).
ActionDelete
)
@@ -38,7 +40,7 @@ type UpdateResult struct {
}
// Update applies RFC 2136 changes. It tries UDP first and retries on TCP when
// the response is truncated.
// the UDP exchange fails or the response is truncated.
func (c *Client) Update(ctx context.Context, changes ...Change) (*UpdateResult, error) {
if err := ctx.Err(); err != nil {
return nil, err
@@ -72,6 +74,7 @@ func (c *Client) Update(ctx context.Context, changes ...Change) (*UpdateResult,
return &UpdateResult{Rcode: dns.RcodeToString[resp.Rcode]}, nil
}
// updateMessage builds a TSIG-signed RFC 2136 UPDATE message.
func (c *Client) updateMessage(changes []Change) (*dns.Msg, error) {
zone := dns.Fqdn(c.zone)
msg := new(dns.Msg)