aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/zone.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/file/zone.go')
-rw-r--r--middleware/file/zone.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/middleware/file/zone.go b/middleware/file/zone.go
index 3d291ba33..57d0cd4a0 100644
--- a/middleware/file/zone.go
+++ b/middleware/file/zone.go
@@ -25,6 +25,15 @@ func NewZone(name string) *Zone {
return z
}
+// Copy copies a zone *without* copying the zone's content. It is not a deep copy.
+func (z *Zone) Copy() *Zone {
+ z1 := NewZone(z.name)
+ z1.TransferTo = z.TransferTo
+ z1.TransferFrom = z.TransferFrom
+ z1.Expired = z.Expired
+ return z1
+}
+
// Insert inserts r into z.
func (z *Zone) Insert(r dns.RR) { z.Tree.Insert(r) }