diff options
-rw-r--r-- | bind/config.go | 14 |
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 | ||
36 | func (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 | |||
36 | func (c *BINDConfig) Zone(view, name string) *Zone { | 50 | func (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) |