getChainUnaryInvoker recursively generate the chained unary invoker.
(interceptors []UnaryClientInterceptor, curr int, finalInvoker UnaryInvoker)
| 539 | |
| 540 | // getChainUnaryInvoker recursively generate the chained unary invoker. |
| 541 | func getChainUnaryInvoker(interceptors []UnaryClientInterceptor, curr int, finalInvoker UnaryInvoker) UnaryInvoker { |
| 542 | if curr == len(interceptors)-1 { |
| 543 | return finalInvoker |
| 544 | } |
| 545 | return func(ctx context.Context, method string, req, reply any, cc *ClientConn, opts ...CallOption) error { |
| 546 | return interceptors[curr+1](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, curr+1, finalInvoker), opts...) |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | // chainStreamClientInterceptors chains all stream client interceptors into one. |
| 551 | func chainStreamClientInterceptors(cc *ClientConn) { |
no outgoing calls
no test coverage detected