From 4dd48338af7f146767245813d718b148629d0fc8 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 30 Jul 2014 07:35:06 +0100 Subject: [PATCH] documentation tweaks --- dns.go | 7 +++---- msg.go | 5 ++++- tsig.go | 2 +- update.go | 18 +++++++++--------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dns.go b/dns.go index 3efbdc08..5becb0a2 100644 --- a/dns.go +++ b/dns.go @@ -49,7 +49,7 @@ // The following is slightly more verbose, but more flexible: // // m1 := new(dns.Msg) -// m1.Id = Id() +// m1.Id = dns.Id() // m1.RecursionDesired = true // m1.Question = make([]Question, 1) // m1.Question[0] = dns.Question{"miek.nl.", dns.TypeMX, dns.ClassINET} @@ -58,7 +58,7 @@ // Basic use pattern for synchronous querying the DNS at a // server configured on 127.0.0.1 and port 53: // -// c := new(Client) +// c := new(dns.Client) // in, rtt, err := c.Exchange(m1, "127.0.0.1:53") // // Suppressing @@ -96,7 +96,6 @@ // // For domain names, in addition to the above rules brackets, periods, // spaces, semicolons and the at symbol are escaped. -// package dns import ( @@ -181,7 +180,7 @@ func (h *RR_Header) len() int { return l } -// find best matching pattern for zone +// Find best matching pattern for zone. func zoneMatch(pattern, zone string) (ok bool) { if len(pattern) == 0 { return diff --git a/msg.go b/msg.go index 83d9c37d..f2e2fcb9 100644 --- a/msg.go +++ b/msg.go @@ -53,7 +53,10 @@ var ( // Id, by default, returns a 16 bits random number to be used as a // message id. The random provided should be good enough. This being a -// variable the function can be overridden with another implementation. +// variable the function can be reassigned to a custom function. +// For instance, to make it return a static value: +// +// dns.Id = func() uint16 { return 3 } var Id func() uint16 = id // A manually-unpacked version of (id, bits). diff --git a/tsig.go b/tsig.go index f6654591..b0262f76 100644 --- a/tsig.go +++ b/tsig.go @@ -302,7 +302,7 @@ func tsigBuffer(msgbuf []byte, rr *TSIG, requestMAC string, timersOnly bool) []b return buf } -// Strip the TSIG from the raw message +// Strip the TSIG from the raw message. func stripTsig(msg []byte) ([]byte, *TSIG, error) { // Copied from msg.go's Unpack() // Header. diff --git a/update.go b/update.go index 6e6f1947..347dcd04 100644 --- a/update.go +++ b/update.go @@ -17,11 +17,11 @@ // // CLASS TYPE RDATA Meaning Function // -------------------------------------------------------------- -// ANY ANY empty Name is in use NameUsed -// ANY rrset empty RRset exists (value indep) RRsetUsed -// NONE ANY empty Name is not in use NameNotUsed -// NONE rrset empty RRset does not exist RRsetNotUsed -// zone rrset rr RRset exists (value dep) Used +// ANY ANY empty Name is in use dns.NameUsed +// ANY rrset empty RRset exists (value indep) dns.RRsetUsed +// NONE ANY empty Name is not in use dns.NameNotUsed +// NONE rrset empty RRset does not exist dns.RRsetNotUsed +// zone rrset rr RRset exists (value dep) dns.Used // // The prerequisite section can also be left empty. // If you have decided on the prerequisites you can tell what RRs should @@ -32,10 +32,10 @@ // // CLASS TYPE RDATA Meaning Function // --------------------------------------------------------------- -// ANY ANY empty Delete all RRsets from name RemoveName -// ANY rrset empty Delete an RRset RemoveRRset -// NONE rrset rr Delete an RR from RRset Remove -// zone rrset rr Add to an RRset Insert +// ANY ANY empty Delete all RRsets from name dns.RemoveName +// ANY rrset empty Delete an RRset dns.RemoveRRset +// NONE rrset rr Delete an RR from RRset dns.Remove +// zone rrset rr Add to an RRset dns.Insert // package dns