Skip to content

Commit 9a90441

Browse files
authored
doc: update client interceptors chaining example with grpc functions (#669)
Replace middleware.ChainXXXClient(...) functions with grpc.WithChainXXXInterceptor(...). Also fix the number of parenthesis in the server interceptors chaining example.
1 parent 71d7422 commit 9a90441

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Simple way of turning a multiple interceptors into a single interceptor. Here's
2121
server chaining:
2222
2323
myServer := grpc.NewServer(
24-
grpc.ChainStreamInterceptor(loggingStream, monitoringStream, authStream)),
24+
grpc.ChainStreamInterceptor(loggingStream, monitoringStream, authStream),
2525
grpc.ChainUnaryInterceptor(loggingUnary, monitoringUnary, authUnary),
2626
)
2727
@@ -31,8 +31,8 @@ Here's an example for client side chaining:
3131
3232
clientConn, err = grpc.Dial(
3333
address,
34-
grpc.WithUnaryInterceptor(middleware.ChainUnaryClient(monitoringClientUnary, retryUnary)),
35-
grpc.WithStreamInterceptor(middleware.ChainStreamClient(monitoringClientStream, retryStream)),
34+
grpc.WithChainUnaryInterceptor(monitoringClientUnary, retryUnary),
35+
grpc.WithChainStreamInterceptor(monitoringClientStream, retryStream),
3636
)
3737
client = testpb.NewTestServiceClient(clientConn)
3838
resp, err := client.PingEmpty(s.ctx, &myservice.Request{Msg: "hello"})

0 commit comments

Comments
 (0)