diff options
author | Mike Crute <mike@crute.us> | 2020-02-13 23:14:18 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-08-11 02:56:10 +0000 |
commit | fa346cbe0ab89b3a3c02d8fae85dc5aa471b62a3 (patch) | |
tree | fbd2d45cdaab047ed93733399f9048716b479217 /bind/config.go | |
parent | 1010edcba255040f8e4140f45f9113969d79effb (diff) | |
download | go_ddns_manager-fa346cbe0ab89b3a3c02d8fae85dc5aa471b62a3.tar.bz2 go_ddns_manager-fa346cbe0ab89b3a3c02d8fae85dc5aa471b62a3.tar.xz go_ddns_manager-fa346cbe0ab89b3a3c02d8fae85dc5aa471b62a3.zip |
WIP: Add more management controllerswip-more-management
Diffstat (limited to 'bind/config.go')
-rw-r--r-- | bind/config.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bind/config.go b/bind/config.go index 42b97cf..9d630f1 100644 --- a/bind/config.go +++ b/bind/config.go | |||
@@ -33,6 +33,21 @@ func (c *BINDConfig) Views() []string { | |||
33 | return v | 33 | return v |
34 | } | 34 | } |
35 | 35 | ||
36 | func (c *BINDConfig) ZonesInView(view string) []*Zone { | ||
37 | out := []*Zone{} | ||
38 | |||
39 | zm, ok := c.zones[view] | ||
40 | if !ok { | ||
41 | return out | ||
42 | } | ||
43 | |||
44 | for _, z := range zm { | ||
45 | out = append(out, z) | ||
46 | } | ||
47 | |||
48 | return out | ||
49 | } | ||
50 | |||
36 | func (c *BINDConfig) Zone(view, name string) *Zone { | 51 | func (c *BINDConfig) Zone(view, name string) *Zone { |
37 | if !strings.HasSuffix(name, ".") { | 52 | if !strings.HasSuffix(name, ".") { |
38 | name = fmt.Sprintf("%s.", name) | 53 | name = fmt.Sprintf("%s.", name) |