aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/protocol.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-09-19 07:29:37 +0100
committerGravatar GitHub <noreply@github.com> 2018-09-19 07:29:37 +0100
commitc349446a23440b336f4ca21900cce4d6a031cdf5 (patch)
tree983ab79eac59d59e36dfbf4a29fcf1bd811110d5 /plugin/forward/protocol.go
parent2f1223c36a0294cd07e299aaa792a0b3f51f687a (diff)
downloadcoredns-c349446a23440b336f4ca21900cce4d6a031cdf5.tar.gz
coredns-c349446a23440b336f4ca21900cce4d6a031cdf5.tar.zst
coredns-c349446a23440b336f4ca21900cce4d6a031cdf5.zip
Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions. This needed to be a new pkg to prevent cyclic import errors. This cleans up a bunch of duplicated code in core/dnsserver that also tried to parse a transport (now all done in transport.Parse). Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/forward/protocol.go')
-rw-r--r--plugin/forward/protocol.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/plugin/forward/protocol.go b/plugin/forward/protocol.go
deleted file mode 100644
index 338b60116..000000000
--- a/plugin/forward/protocol.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package forward
-
-// Copied from coredns/core/dnsserver/address.go
-
-import (
- "strings"
-)
-
-// protocol returns the protocol of the string s. The second string returns s
-// with the prefix chopped off.
-func protocol(s string) (int, string) {
- switch {
- case strings.HasPrefix(s, _tls+"://"):
- return TLS, s[len(_tls)+3:]
- case strings.HasPrefix(s, _dns+"://"):
- return DNS, s[len(_dns)+3:]
- }
- return DNS, s
-}
-
-// Supported protocols.
-const (
- DNS = iota + 1
- TLS
-)
-
-const (
- _dns = "dns"
- _tls = "tls"
-)