Change SelectFilter to Filter
This commit is contained in:
parent
a4c05fd6ad
commit
4d4f842702
@ -41,7 +41,7 @@ func (dc *dcWrapper) Call(ctx context.Context, req client.Request, rsp interface
|
||||
}
|
||||
|
||||
callOptions := append(opts, client.WithSelectOption(
|
||||
selector.Filter(filter),
|
||||
selector.WithFilter(filter),
|
||||
))
|
||||
|
||||
fmt.Printf("[DC Wrapper] filtering for datacenter %s\n", md["datacenter"])
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user