La context (#521)

* middleware/proxy: give Exchange a context

Make context.Context the first paramater in the Exchange method.
This is inline with all other query functions.

* up the version
This commit is contained in:
Miek Gieben
2017-02-11 16:56:04 +00:00
committed by GitHub
parent 5f6c7682be
commit a5f3cb5fe5
6 changed files with 11 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
package proxy
import (
"context"
"github.com/miekg/coredns/request"
"github.com/miekg/dns"
)
@@ -8,7 +10,7 @@ import (
// Exchanger is an interface that specifies a type implementing a DNS resolver that
// can use whatever transport it likes.
type Exchanger interface {
Exchange(addr string, state request.Request) (*dns.Msg, error)
Exchange(ctx context.Context, addr string, state request.Request) (*dns.Msg, error)
Protocol() string
OnStartup(*Proxy) error