aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/proxy/errors.go
diff options
context:
space:
mode:
authorGravatar Pat Downey <patdowney@users.noreply.github.com> 2023-03-24 12:55:51 +0000
committerGravatar GitHub <noreply@github.com> 2023-03-24 08:55:51 -0400
commitf823825f8a34edb85d5d18cd5d2f6f850adf408e (patch)
tree79d241ab9b4c7c343d806f4041c8efccbe3f9ca0 /plugin/pkg/proxy/errors.go
parent47dceabfc6465ba6c5d41472d6602d4ad5c9fb1b (diff)
downloadcoredns-f823825f8a34edb85d5d18cd5d2f6f850adf408e.tar.gz
coredns-f823825f8a34edb85d5d18cd5d2f6f850adf408e.tar.zst
coredns-f823825f8a34edb85d5d18cd5d2f6f850adf408e.zip
plugin/forward: Allow Proxy to be used outside of forward plugin. (#5951)
* plugin/forward: Move Proxy into pkg/plugin/proxy, to allow forward.Proxy to be used outside of forward plugin. Signed-off-by: Patrick Downey <patrick.downey@dioadconsulting.com>
Diffstat (limited to 'plugin/pkg/proxy/errors.go')
-rw-r--r--plugin/pkg/proxy/errors.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugin/pkg/proxy/errors.go b/plugin/pkg/proxy/errors.go
new file mode 100644
index 000000000..461236423
--- /dev/null
+++ b/plugin/pkg/proxy/errors.go
@@ -0,0 +1,26 @@
+package proxy
+
+import (
+ "errors"
+)
+
+var (
+ // ErrNoHealthy means no healthy proxies left.
+ ErrNoHealthy = errors.New("no healthy proxies")
+ // ErrNoForward means no forwarder defined.
+ ErrNoForward = errors.New("no forwarder defined")
+ // ErrCachedClosed means cached connection was closed by peer.
+ ErrCachedClosed = errors.New("cached connection was closed by peer")
+)
+
+// Options holds various Options that can be set.
+type Options struct {
+ // ForceTCP use TCP protocol for upstream DNS request. Has precedence over PreferUDP flag
+ ForceTCP bool
+ // PreferUDP use UDP protocol for upstream DNS request.
+ PreferUDP bool
+ // HCRecursionDesired sets recursion desired flag for Proxy healthcheck requests
+ HCRecursionDesired bool
+ // HCDomain sets domain for Proxy healthcheck requests
+ HCDomain string
+}