allow setting registry router in client
This commit is contained in:
parent
50ec6c748f
commit
4fd4a116f2
@ -7,6 +7,7 @@ import (
|
||||
"github.com/micro/go-micro/v3/broker"
|
||||
"github.com/micro/go-micro/v3/broker/http"
|
||||
"github.com/micro/go-micro/v3/codec"
|
||||
"github.com/micro/go-micro/v3/registry"
|
||||
"github.com/micro/go-micro/v3/router"
|
||||
regRouter "github.com/micro/go-micro/v3/router/registry"
|
||||
"github.com/micro/go-micro/v3/selector"
|
||||
@ -184,6 +185,13 @@ func Transport(t transport.Transport) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Registry sets the routers registry
|
||||
func Registry(r registry.Registry) Option {
|
||||
return func(o *Options) {
|
||||
o.Router.Init(router.Registry(r))
|
||||
}
|
||||
}
|
||||
|
||||
// Router is used to lookup routes for a service
|
||||
func Router(r router.Router) Option {
|
||||
return func(o *Options) {
|
||||
|
Loading…
Reference in New Issue
Block a user