selector: add filters to replace depricated client/selector filters (#1785)

This commit is contained in:
ben-toogood
2020-07-02 16:09:48 +01:00
committed by GitHub
parent d577dd6abe
commit 6898a65508
7 changed files with 86 additions and 91 deletions

View File

@@ -21,7 +21,7 @@ type Selector interface {
// Options the selector is using
Options() Options
// Select a route from the pool using the strategy
Select([]router.Route) (*router.Route, error)
Select([]router.Route, ...SelectOption) (*router.Route, error)
// Record the error returned from a route to inform future selection
Record(router.Route, error) error
// Close the selector
@@ -30,12 +30,6 @@ type Selector interface {
String() string
}
// Options used to configure a selector
type Options struct{}
// Option updates the options
type Option func(*Options)
// NewSelector creates new selector and returns it
func NewSelector(opts ...Option) Selector {
return newSelector(opts...)