aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/notify.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-09-07 11:10:16 +0100
committerGravatar GitHub <noreply@github.com> 2016-09-07 11:10:16 +0100
commitd1f17fa7e061d91aa0af7e1fb959a68db899c812 (patch)
tree0f828a0e7bd8ca86051a721dae48e8c19a0a2f0e /middleware/file/notify.go
parent684330fd28f65a7a8d1ad01fb4c6c5db78240f29 (diff)
downloadcoredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.tar.gz
coredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.tar.zst
coredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.zip
Cleanup: put middleware helper functions in pkgs (#245)
Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go
Diffstat (limited to 'middleware/file/notify.go')
-rw-r--r--middleware/file/notify.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/middleware/file/notify.go b/middleware/file/notify.go
index 8a2581b84..3c6095a3b 100644
--- a/middleware/file/notify.go
+++ b/middleware/file/notify.go
@@ -5,6 +5,7 @@ import (
"log"
"github.com/miekg/coredns/middleware"
+ "github.com/miekg/coredns/request"
"github.com/miekg/dns"
)
@@ -12,7 +13,7 @@ import (
// isNotify checks if state is a notify message and if so, will *also* check if it
// is from one of the configured masters. If not it will not be a valid notify
// message. If the zone z is not a secondary zone the message will also be ignored.
-func (z *Zone) isNotify(state middleware.State) bool {
+func (z *Zone) isNotify(state request.Request) bool {
if state.Req.Opcode != dns.OpcodeNotify {
return false
}
@@ -56,7 +57,7 @@ func notify(zone string, to []string) error {
func notifyAddr(c *dns.Client, m *dns.Msg, s string) error {
for i := 0; i < 3; i++ {
- ret, err := middleware.Exchange(c, m, s)
+ ret, _, err := c.Exchange(m, s)
if err != nil {
continue
}