summaryrefslogtreecommitdiff
path: root/bind/config.go
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2020-02-13 23:14:18 +0000
committerMike Crute <mike@crute.us>2020-08-11 02:56:10 +0000
commitfa346cbe0ab89b3a3c02d8fae85dc5aa471b62a3 (patch)
treefbd2d45cdaab047ed93733399f9048716b479217 /bind/config.go
parent1010edcba255040f8e4140f45f9113969d79effb (diff)
downloadgo_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.go15
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
36func (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
36func (c *BINDConfig) Zone(view, name string) *Zone { 51func (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)