From cb102cb08dd81449ee94f0b8699a0d04c4c33868 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sat, 6 May 2017 15:39:16 -0700 Subject: [PATCH] fix(transport/grpc): add client option to disable prefix Add a ClientOption to revert the auto-prefixing of "pb" to service names when there's no other prefix already specified. Relates to #447. --- transport/grpc/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport/grpc/client.go b/transport/grpc/client.go index c0faa2b36..36f7cc483 100644 --- a/transport/grpc/client.go +++ b/transport/grpc/client.go @@ -79,6 +79,11 @@ func ClientAfter(after ...ClientResponseFunc) ClientOption { return func(c *Client) { c.after = append(c.after, after...) } } +// ClientNoPrefix reverts the auto-prefixing of "pb" to serviceName. +func ClientNoPrefix() ClientOption { + return func(c *Client) { c.method = strings.Replace(c.method, "/pb.", "/", 1) } +} + // Endpoint returns a usable endpoint that will invoke the gRPC specified by the // client. func (c Client) Endpoint() endpoint.Endpoint {