Change SelectFilter to Filter
This commit is contained in:
@@ -15,7 +15,7 @@ type Options struct {
|
||||
}
|
||||
|
||||
type SelectOptions struct {
|
||||
Filters []SelectFilter
|
||||
Filters []Filter
|
||||
|
||||
// Other options for implementations of the interface
|
||||
// can be stored in a context
|
||||
@@ -35,9 +35,9 @@ func Registry(r registry.Registry) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Filter adds a filter function to the list of filters
|
||||
// WithFilter adds a filter function to the list of filters
|
||||
// used during the Select call.
|
||||
func Filter(fn SelectFilter) SelectOption {
|
||||
func WithFilter(fn Filter) SelectOption {
|
||||
return func(o *SelectOptions) {
|
||||
o.Filters = append(o.Filters, fn)
|
||||
}
|
||||
|
@@ -82,8 +82,8 @@ type Selector interface {
|
||||
// based on the selector's algorithm
|
||||
type Next func() (*registry.Node, error)
|
||||
|
||||
// SelectFilter is used to filter a service during the selection process
|
||||
type SelectFilter func([]*registry.Service) []*registry.Service
|
||||
// Filter is used to filter a service during the selection process
|
||||
type Filter func([]*registry.Service) []*registry.Service
|
||||
|
||||
var (
|
||||
DefaultSelector = newRandomSelector()
|
||||
|
Reference in New Issue
Block a user