diff --git a/client/options.go b/client/options.go index a4adeb0a..3fc5a3f2 100644 --- a/client/options.go +++ b/client/options.go @@ -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) {