diff options
author | 2017-12-12 15:40:30 -0500 | |
---|---|---|
committer | 2017-12-12 20:40:30 +0000 | |
commit | a469a17cdfccfb435f819ebdf7ff7b43b207c8b4 (patch) | |
tree | 7fefd2e00383f8b920826af4f1f42706e0ebe82e /plugin/autopath/autopath.go | |
parent | 99e163c37511ce48eaa7c86ba7791937e32e0a52 (diff) | |
download | coredns-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.go | 6 |
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 |