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
This commit is contained in:
parent
99e163c375
commit
a469a17cdf
8 changed files with 63 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue