summaryrefslogtreecommitdiff
path: root/bind/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'bind/config.go')
-rw-r--r--bind/config.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/bind/config.go b/bind/config.go
index 42b97cf..1d4a81a 100644
--- a/bind/config.go
+++ b/bind/config.go
@@ -33,6 +33,20 @@ func (c *BINDConfig) Views() []string {
33 return v 33 return v
34} 34}
35 35
36func (c *BINDConfig) ZonesInView(view string) []*Zone {
37 if _, ok := c.zones[view]; !ok {
38 return nil
39 }
40
41 out := []*Zone{}
42
43 for _, z := range c.zones[view] {
44 out = append(out, z)
45 }
46
47 return out
48}
49
36func (c *BINDConfig) Zone(view, name string) *Zone { 50func (c *BINDConfig) Zone(view, name string) *Zone {
37 if !strings.HasSuffix(name, ".") { 51 if !strings.HasSuffix(name, ".") {
38 name = fmt.Sprintf("%s.", name) 52 name = fmt.Sprintf("%s.", name)