aboutsummaryrefslogtreecommitdiff
path: root/plugin/autopath/autopath.go
diff options
context:
space:
mode:
authorGravatar James Hartig <fastest963@gmail.com> 2017-12-12 15:40:30 -0500
committerGravatar Miek Gieben <miek@miek.nl> 2017-12-12 20:40:30 +0000
commita469a17cdfccfb435f819ebdf7ff7b43b207c8b4 (patch)
tree7fefd2e00383f8b920826af4f1f42706e0ebe82e /plugin/autopath/autopath.go
parent99e163c37511ce48eaa7c86ba7791937e32e0a52 (diff)
downloadcoredns-a469a17cdfccfb435f819ebdf7ff7b43b207c8b4.tar.gz
coredns-a469a17cdfccfb435f819ebdf7ff7b43b207c8b4.tar.zst
coredns-a469a17cdfccfb435f819ebdf7ff7b43b207c8b4.zip
Instead of hardcoding plugin lists in autopath/health, use interfaces. (#1306)
Switched health and autopath plugin to allow any plugins to be used instead of a hardcoded list. I did not switch federation over since it wasn't obvious that anything other than kubernetes could be used with it. Fixes #1291
Diffstat (limited to 'plugin/autopath/autopath.go')
-rw-r--r--plugin/autopath/autopath.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/autopath/autopath.go b/plugin/autopath/autopath.go
index 2ca6c4df8..1a2e7a5ec 100644
--- a/plugin/autopath/autopath.go
+++ b/plugin/autopath/autopath.go
@@ -46,6 +46,12 @@ import (
// If Func returns a nil slice, no autopathing will be done.
type Func func(request.Request) []string
+// AutoPather defines the interface that a plugin should implement in order to be
+// used by AutoPath.
+type AutoPather interface {
+ AutoPath(request.Request) []string
+}
+
// AutoPath perform autopath: service side search path completion.
type AutoPath struct {
Next plugin.Handler