Add the notion of a node selector for routing
This commit is contained in:
@@ -14,6 +14,7 @@ type options struct {
|
||||
registry registry.Registry
|
||||
transport transport.Transport
|
||||
wrappers []Wrapper
|
||||
selector NodeSelector
|
||||
}
|
||||
|
||||
// Broker to be used for pub/sub
|
||||
@@ -51,6 +52,13 @@ func Transport(t transport.Transport) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Selector is used to select a node to route a request to
|
||||
func Selector(s NodeSelector) Option {
|
||||
return func(o *options) {
|
||||
o.selector = s
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a Wrapper to a list of options passed into the client
|
||||
func Wrap(w Wrapper) Option {
|
||||
return func(o *options) {
|
||||
|
Reference in New Issue
Block a user