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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user