client/selector: query across multiple domains (#1725)
* client/selector: query across multiple domains * client/selector: check for nil services * config/cmd: fix merge bug
This commit is contained in:
@@ -10,6 +10,9 @@ type Options struct {
|
||||
Registry registry.Registry
|
||||
Strategy Strategy
|
||||
|
||||
// Domain to lookup services from within the registry
|
||||
Domain string
|
||||
|
||||
// Other options for implementations of the interface
|
||||
// can be stored in a context
|
||||
Context context.Context
|
||||
@@ -37,6 +40,13 @@ func Registry(r registry.Registry) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Domain sets the domain used by the selector
|
||||
func Domain(d string) Option {
|
||||
return func(o *Options) {
|
||||
o.Domain = d
|
||||
}
|
||||
}
|
||||
|
||||
// SetStrategy sets the default strategy for the selector
|
||||
func SetStrategy(fn Strategy) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
Reference in New Issue
Block a user