aboutsummaryrefslogtreecommitdiff
path: root/middleware/proxy/exchanger.go
blob: 29974a2890abc84a457eadbad53a1cdaa63cd03c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package proxy

import (
	"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(request.Request) (*dns.Msg, error)
	SetUpstream(Upstream) error // (Re)set the upstream
	OnStartup() error
	OnShutdown() error
	Protocol() protocol
}

type protocol string