mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 01:04:15 -04:00
27 lines
383 B
Go
27 lines
383 B
Go
|
|
package file
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/miekg/coredns/middleware/file/tree"
|
||
|
|
|
||
|
|
"github.com/miekg/dns"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Zone struct {
|
||
|
|
SOA *dns.SOA
|
||
|
|
SIG []*dns.RRSIG
|
||
|
|
name string
|
||
|
|
*tree.Tree
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewZone(name string) *Zone {
|
||
|
|
return &Zone{name: dns.Fqdn(name), Tree: &tree.Tree{}}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (z *Zone) Insert(r dns.RR) {
|
||
|
|
z.Tree.Insert(r)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (z *Zone) Delete(r dns.RR) {
|
||
|
|
z.Tree.Delete(r)
|
||
|
|
}
|