Make it easier to add select filters
This commit is contained in:
parent
ed764ca0b2
commit
d6fdfc252e
@ -187,9 +187,9 @@ func DialTimeout(d time.Duration) Option {
|
||||
|
||||
// Call Options
|
||||
|
||||
func WithSelectOption(so selector.SelectOption) CallOption {
|
||||
func WithSelectOption(so ...selector.SelectOption) CallOption {
|
||||
return func(o *CallOptions) {
|
||||
o.SelectOptions = append(o.SelectOptions, so)
|
||||
o.SelectOptions = append(o.SelectOptions, so...)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ func Registry(r registry.Registry) Option {
|
||||
|
||||
// WithFilter adds a filter function to the list of filters
|
||||
// used during the Select call.
|
||||
func WithFilter(fn Filter) SelectOption {
|
||||
func WithFilter(fn ...Filter) SelectOption {
|
||||
return func(o *SelectOptions) {
|
||||
o.Filters = append(o.Filters, fn)
|
||||
o.Filters = append(o.Filters, fn...)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user