From b97c3c41606d622612737050d2f41f3f74c36963 Mon Sep 17 00:00:00 2001 From: chenzhihui Date: Wed, 3 Mar 2021 23:09:35 +0800 Subject: [PATCH] fix registry option --- app.go | 4 ++-- options.go | 4 ++-- transport/grpc/client.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app.go b/app.go index a451ce010..3f6cd0951 100644 --- a/app.go +++ b/app.go @@ -57,8 +57,8 @@ func (a *App) Server() []transport.Server { return a.opts.servers } -// Registrar returns registry. -func (a *App) Registrar() registry.Registrar { +// Registry returns registry. +func (a *App) Registry() registry.Registrar { return a.opts.registrar } diff --git a/options.go b/options.go index cecb4eaa0..759fcca70 100644 --- a/options.go +++ b/options.go @@ -69,8 +69,8 @@ func Logger(logger log.Logger) Option { return func(o *options) { o.logger = logger } } -// Registrar with service registry. -func Registrar(r registry.Registrar) Option { +// Registry with service registry. +func Registry(r registry.Registrar) Option { return func(o *options) { o.registrar = r } } diff --git a/transport/grpc/client.go b/transport/grpc/client.go index 330b65531..e4959cd9e 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -38,8 +38,8 @@ func WithMiddleware(m middleware.Middleware) ClientOption { } } -// WithDiscoverer with client registry. -func WithDiscoverer(d registry.Discoverer) ClientOption { +// WithRegistry with client registry. +func WithRegistry(d registry.Discoverer) ClientOption { return func(o *clientOptions) { o.discoverer = d }