fix zrpc client interceptor calling problem
This commit is contained in:
@@ -19,7 +19,6 @@ type (
|
||||
ClientOption = internal.ClientOption
|
||||
|
||||
Client interface {
|
||||
AddInterceptor(interceptor grpc.UnaryClientInterceptor)
|
||||
Conn() *grpc.ClientConn
|
||||
}
|
||||
|
||||
@@ -66,8 +65,8 @@ func NewClient(c RpcClientConf, options ...ClientOption) (Client, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewClientNoAuth(c discov.EtcdConf) (Client, error) {
|
||||
client, err := internal.NewClient(internal.BuildDiscovTarget(c.Hosts, c.Key))
|
||||
func NewClientNoAuth(c discov.EtcdConf, opts ...ClientOption) (Client, error) {
|
||||
client, err := internal.NewClient(internal.BuildDiscovTarget(c.Hosts, c.Key), opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -81,10 +80,6 @@ func NewClientWithTarget(target string, opts ...ClientOption) (Client, error) {
|
||||
return internal.NewClient(target, opts...)
|
||||
}
|
||||
|
||||
func (rc *RpcClient) AddInterceptor(interceptor grpc.UnaryClientInterceptor) {
|
||||
rc.client.AddInterceptor(interceptor)
|
||||
}
|
||||
|
||||
func (rc *RpcClient) Conn() *grpc.ClientConn {
|
||||
return rc.client.Conn()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user