mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-16 02:47:03 +02:00
11cd43e3c3
* unify selector Co-authored-by: caoguoliang01 <caoguoliang01@bilibili.com> Co-authored-by: chenzhihui <zhihui_chen@foxmail.com>
17 lines
343 B
Go
17 lines
343 B
Go
package selector
|
|
|
|
// SelectOptions is Select Options.
|
|
type SelectOptions struct {
|
|
NodeFilters []NodeFilter
|
|
}
|
|
|
|
// SelectOption is Selector option.
|
|
type SelectOption func(*SelectOptions)
|
|
|
|
// WithNodeFilter with filter options
|
|
func WithNodeFilter(fn ...NodeFilter) SelectOption {
|
|
return func(opts *SelectOptions) {
|
|
opts.NodeFilters = fn
|
|
}
|
|
}
|