documentation tweaks

This commit is contained in:
Miek Gieben 2014-07-30 07:35:06 +01:00
parent 1243dcbc89
commit 4dd48338af
4 changed files with 17 additions and 15 deletions

7
dns.go
View File

@ -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

5
msg.go
View File

@ -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).

View File

@ -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.

View File

@ -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