summaryrefslogtreecommitdiff
path: root/update.go
diff options
context:
space:
mode:
authorTero Marttila <[email protected]>2016-06-19 22:50:21 +0300
committerTero Marttila <[email protected]>2016-06-19 22:50:21 +0300
commit6acc13e01076dd042f22d5c156b586b57d80523d (patch)
tree45558a6b0f84c026bd6f46aaf7a529bfd3769b78 /update.go
parent89f642d6ff4feff12dba741b08c13b8dc82f8fbc (diff)
go fmt
Diffstat (limited to 'update.go')
-rw-r--r--update.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/update.go b/update.go
index e9750a7..2e37108 100644
--- a/update.go
+++ b/update.go
@@ -1,31 +1,31 @@
package main
import (
- "github.com/miekg/dns"
- "time"
"fmt"
- "net"
+ "github.com/miekg/dns"
"log"
+ "net"
+ "time"
)
type updateState struct {
- updateZone string
- removeNames []dns.RR
- inserts []dns.RR
+ updateZone string
+ removeNames []dns.RR
+ inserts []dns.RR
}
type Update struct {
- ttl int
- timeout time.Duration
- retry time.Duration
- verbose bool
+ ttl int
+ timeout time.Duration
+ retry time.Duration
+ verbose bool
- zone string
- name string
+ zone string
+ name string
- tsig map[string]string
+ tsig map[string]string
tsigAlgo TSIGAlgorithm
- server string
+ server string
updateChan chan updateState
doneChan chan error
@@ -77,7 +77,7 @@ func (u *Update) buildAddr(ip net.IP) dns.RR {
if ip4 := ip.To4(); ip4 != nil {
return &dns.A{
Hdr: dns.RR_Header{Name: u.name, Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: uint32(u.ttl)},
- A: ip4,
+ A: ip4,
}
}
@@ -93,10 +93,10 @@ func (u *Update) buildAddr(ip net.IP) dns.RR {
func (u *Update) buildState(addrs *AddrSet) (state updateState, err error) {
state.updateZone = u.zone
state.removeNames = []dns.RR{
- &dns.RR_Header{Name:u.name},
+ &dns.RR_Header{Name: u.name},
}
- addrs.Each(func(ip net.IP){
+ addrs.Each(func(ip net.IP) {
state.inserts = append(state.inserts, u.buildAddr(ip))
})
@@ -173,7 +173,7 @@ func (u *Update) run() {
var updateChan = u.updateChan
var updateError error
- defer func(){u.doneChan <-updateError}()
+ defer func() { u.doneChan <- updateError }()
for {
select {