mirror of
https://github.com/miekg/dns.git
synced 2025-10-11 09:51:01 +02:00
documentation
This commit is contained in:
parent
c104ee05b8
commit
ec11e6abd3
10
dns.go
10
dns.go
@ -96,8 +96,8 @@ func (s RRset) String() string {
|
|||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the last pushed RR from the RRset. Return nil
|
// Pop removes the last pushed RR from the RRset. Returns nil
|
||||||
// when there is nothing to remove
|
// when there is nothing to remove.
|
||||||
func (s *RRset) Pop() RR {
|
func (s *RRset) Pop() RR {
|
||||||
if len(*s) == 0 {
|
if len(*s) == 0 {
|
||||||
return nil
|
return nil
|
||||||
@ -108,7 +108,7 @@ func (s *RRset) Pop() RR {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Push the RR r to the RRset
|
// Push pushes the RR r to the RRset.
|
||||||
func (s *RRset) Push(r RR) bool {
|
func (s *RRset) Push(r RR) bool {
|
||||||
if s.Len() == 0 {
|
if s.Len() == 0 {
|
||||||
*s = append(*s, r)
|
*s = append(*s, r)
|
||||||
@ -129,7 +129,7 @@ func (s *RRset) Push(r RR) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the RRset is RFC 2181 compliant.
|
// Ok checks if the RRSet is RFC 2181 compliant.
|
||||||
func (s RRset) Ok() bool {
|
func (s RRset) Ok() bool {
|
||||||
ttl := s[0].Header().Ttl
|
ttl := s[0].Header().Ttl
|
||||||
name := s[0].Header().Name
|
name := s[0].Header().Name
|
||||||
@ -218,7 +218,7 @@ func zoneMatch(pattern, zone string) (ok bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// DnameLength returns the length of a packed dname
|
// DnameLength returns the length of a packed dname.
|
||||||
func DomainNameLength(s string) int { // TODO better name
|
func DomainNameLength(s string) int { // TODO better name
|
||||||
// Add trailing dot to canonicalize name.
|
// Add trailing dot to canonicalize name.
|
||||||
if n := len(s); n == 0 || s[n-1] != '.' {
|
if n := len(s); n == 0 || s[n-1] != '.' {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user