MCPcopy
hub / github.com/grpc/grpc-go / chainUnaryInterceptors

Function chainUnaryInterceptors

server.go:1245–1249  ·  view source on GitHub ↗
(interceptors []UnaryServerInterceptor)

Source from the content-addressed store, hash-verified

1243}
1244
1245func chainUnaryInterceptors(interceptors []UnaryServerInterceptor) UnaryServerInterceptor {
1246 return func(ctx context.Context, req any, info *UnaryServerInfo, handler UnaryHandler) (any, error) {
1247 return interceptors[0](ctx, req, info, getChainUnaryHandler(interceptors, 0, info, handler))
1248 }
1249}
1250
1251func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler) UnaryHandler {
1252 if curr == len(interceptors)-1 {

Callers 2

Calls 1

getChainUnaryHandlerFunction · 0.85

Tested by 1