* 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
18 lines
408 B
Go
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
|
|
}
|