coredns/middleware/proxy/exchanger.go
Miek Gieben a5f3cb5fe5 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
2017-02-11 16:56:04 +00:00

18 lines
408 B
Go

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