| 1243 | } |
| 1244 | |
| 1245 | func 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 | |
| 1251 | func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler) UnaryHandler { |
| 1252 | if curr == len(interceptors)-1 { |