mirror of
https://github.com/miekg/dns.git
synced 2025-10-18 13:21:15 +02:00
More zone updates
This commit is contained in:
parent
00ddf6551c
commit
6e31effe78
6
zone.go
6
zone.go
@ -6,11 +6,16 @@ import (
|
|||||||
"github.com/sauerbraten/radix"
|
"github.com/sauerbraten/radix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Zone represents a DNS zone.
|
||||||
type Zone struct {
|
type Zone struct {
|
||||||
Name string // Name of the zone
|
Name string // Name of the zone
|
||||||
*radix.Radix // Zone data
|
*radix.Radix // Zone data
|
||||||
|
|
||||||
|
// soa parameters in here TODO(mg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ZoneData holds all the RR belonging to Name.
|
||||||
|
// TODO(mg): uitbreiden
|
||||||
type ZoneData struct {
|
type ZoneData struct {
|
||||||
Name string // Domain name for this node
|
Name string // Domain name for this node
|
||||||
RR map[uint16][]RR // Map of the RR type to the RR
|
RR map[uint16][]RR // Map of the RR type to the RR
|
||||||
@ -26,6 +31,7 @@ func NewZone(name string) *Zone {
|
|||||||
return z
|
return z
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert inserts an RR into the zone. Overwrites.
|
||||||
func (z *Zone) Insert(r RR) {
|
func (z *Zone) Insert(r RR) {
|
||||||
zd := z.Radix.Find(r.Header().Name)
|
zd := z.Radix.Find(r.Header().Name)
|
||||||
if zd == nil {
|
if zd == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user